some test cleanups & category reorganization (#22010)

* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
This commit is contained in:
metagn
2023-06-06 07:54:07 +03:00
committed by GitHub
parent 2ab948ce53
commit b97d603cd0
134 changed files with 189 additions and 374 deletions

View File

@@ -0,0 +1,31 @@
type
Hash*[bits: static[int]] = object
data*: array[bits div 8, uint8]
{.emit: """
void sha_256(void* input, int input_len, void* output, int output_len) {}
void sha_512(void* input, int input_len, void* output, int output_len) {}
void keccak_256(void* input, int input_len, void* output, int output_len) {}
void keccak_512(void* input, int input_len, void* output, int output_len) {}
""".}
template defineKeccak(bits: untyped) =
proc `extKeccak bits`(output: pointer, outSize: csize_t, input: pointer, inputSize: csize_t) {.nodecl, importc: "keccak_" & astToStr(bits).}
template defineSha(bits: static[int]) =
proc `extSha bits`(output: pointer, outSize: csize_t, input: pointer, inputSize: csize_t) {.nodecl, importc: "sha_" & astToStr(bits).}
template defineHashProcs(bits) =
defineSha(bits)
defineKeccak(bits)
defineHashProcs(256)
defineHashProcs(512)
extSha256(nil, 0, nil, 0)
extSha512(nil, 0, nil, 0)
extKeccak256(nil, 0, nil, 0)
extKeccak512(nil, 0, nil, 0)

View File

@@ -1,9 +1,6 @@
discard """
disabled: true
output: "####"
joinable: false
"""
# unfortunately our tester doesn't support multiple lines of compiler
# error messages yet...
# bug #1562
type Foo* {.pure, final.} = object
@@ -30,4 +27,4 @@ import sequtils
(var i = @[""];i).applyIt(it)
# now works:
echo "##", i[0], "##"
doAssert i[0] == ""