Update tests\core\encoding\cbor to use new test runner.

It was leaky and required a substantial number of `loc := #caller_location` additions to parts of the core library to make it easier to track down how and where it leaked.

The tests now run fine multi-threaded.
This commit is contained in:
Jeroen van Rijn
2024-06-02 14:47:07 -04:00
committed by Feoramund
parent 6a1649d8aa
commit a27b167218
11 changed files with 323 additions and 420 deletions
+4 -4
View File
@@ -350,9 +350,9 @@ Output:
ab
*/
write_byte :: proc(b: ^Builder, x: byte) -> (n: int) {
write_byte :: proc(b: ^Builder, x: byte, loc := #caller_location) -> (n: int) {
n0 := len(b.buf)
append(&b.buf, x)
append(&b.buf, x, loc)
n1 := len(b.buf)
return n1-n0
}
@@ -380,9 +380,9 @@ NOTE: The backing dynamic array may be fixed in capacity or fail to resize, `n`
Returns:
- n: The number of bytes appended
*/
write_bytes :: proc(b: ^Builder, x: []byte) -> (n: int) {
write_bytes :: proc(b: ^Builder, x: []byte, loc := #caller_location) -> (n: int) {
n0 := len(b.buf)
append(&b.buf, ..x)
append(&b.buf, ..x, loc=loc)
n1 := len(b.buf)
return n1-n0
}