mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-11 12:58:10 +00:00
Correct naming in tests
This commit is contained in:
@@ -8,7 +8,7 @@ import "core:time"
|
||||
|
||||
doc_print :: proc(doc: ^xml.Document) {
|
||||
buf: strings.Builder
|
||||
defer strings.destroy_builder(&buf)
|
||||
defer strings.builder_destroy(&buf)
|
||||
w := strings.to_writer(&buf)
|
||||
|
||||
xml.print(w, doc)
|
||||
|
||||
@@ -84,7 +84,7 @@ example :: proc() {
|
||||
|
||||
doc_hash :: proc(doc: ^xml.Document, print := false) -> (crc32: u32) {
|
||||
buf: strings.Builder
|
||||
defer strings.destroy_builder(&buf)
|
||||
defer strings.builder_destroy(&buf)
|
||||
w := strings.to_writer(&buf)
|
||||
|
||||
xml.print(w, doc)
|
||||
|
||||
@@ -45,7 +45,7 @@ generate_encoding_entity_table :: proc() {
|
||||
printf("\"%v\" loaded and parsed.\n", filename)
|
||||
|
||||
generated_buf: strings.Builder
|
||||
defer strings.destroy_builder(&generated_buf)
|
||||
defer strings.builder_destroy(&generated_buf)
|
||||
w := strings.to_writer(&generated_buf)
|
||||
|
||||
charlist, charlist_ok := xml.find_child_by_ident(doc.root, "charlist")
|
||||
|
||||
@@ -79,8 +79,8 @@ test_leb128 :: proc(t: ^testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
for num_bytes in 1..uint(16) {
|
||||
for _ in 0..RANDOM_TESTS {
|
||||
for num_bytes in 1..=uint(16) {
|
||||
for _ in 0..=RANDOM_TESTS {
|
||||
unsigned, signed := get_random(num_bytes)
|
||||
|
||||
{
|
||||
@@ -109,7 +109,7 @@ test_leb128 :: proc(t: ^testing.T) {
|
||||
get_random :: proc(byte_count: uint) -> (u: u128, i: i128) {
|
||||
assert(byte_count >= 0 && byte_count <= size_of(u128))
|
||||
|
||||
for _ in 1..byte_count {
|
||||
for _ in 1..=byte_count {
|
||||
u <<= 8
|
||||
u |= u128(rand.uint32() & 0xff)
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ doc_to_string :: proc(doc: ^xml.Document) -> (result: string) {
|
||||
}
|
||||
|
||||
buf: strings.Builder
|
||||
defer strings.destroy_builder(&buf)
|
||||
defer strings.builder_destroy(&buf)
|
||||
|
||||
print(strings.to_writer(&buf), doc)
|
||||
return strings.clone(strings.to_string(buf))
|
||||
|
||||
Reference in New Issue
Block a user