| ... | ... | @@ -318,9 +318,12 @@ pub fn PackedIntSliceEndian(comptime Int: type, comptime endian: builtin.Endian) |
| 318 | 318 | }; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | const we_are_testing_this_with_stage1_which_leaks_comptime_memory = true; |
| 322 | |
| 321 | 323 | test "PackedIntArray" { |
| 322 | 324 | // TODO @setEvalBranchQuota generates panics in wasm32. Investigate. |
| 323 | 325 | if (builtin.arch == .wasm32) return error.SkipZigTest; |
| 326 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 324 | 327 | |
| 325 | 328 | @setEvalBranchQuota(10000); |
| 326 | 329 | const max_bits = 256; |
| ... | ... | @@ -358,6 +361,7 @@ test "PackedIntArray" { |
| 358 | 361 | } |
| 359 | 362 | |
| 360 | 363 | test "PackedIntArray init" { |
| 364 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 361 | 365 | const PackedArray = PackedIntArray(u3, 8); |
| 362 | 366 | var packed_array = PackedArray.init([_]u3{ 0, 1, 2, 3, 4, 5, 6, 7 }); |
| 363 | 367 | var i = @as(usize, 0); |
| ... | ... | @@ -367,6 +371,7 @@ test "PackedIntArray init" { |
| 367 | 371 | test "PackedIntSlice" { |
| 368 | 372 | // TODO @setEvalBranchQuota generates panics in wasm32. Investigate. |
| 369 | 373 | if (builtin.arch == .wasm32) return error.SkipZigTest; |
| 374 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 370 | 375 | |
| 371 | 376 | @setEvalBranchQuota(10000); |
| 372 | 377 | const max_bits = 256; |
| ... | ... | @@ -405,6 +410,7 @@ test "PackedIntSlice" { |
| 405 | 410 | } |
| 406 | 411 | |
| 407 | 412 | test "PackedIntSlice of PackedInt(Array/Slice)" { |
| 413 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 408 | 414 | const max_bits = 16; |
| 409 | 415 | const int_count = 19; |
| 410 | 416 | |
| ... | ... | @@ -470,6 +476,7 @@ test "PackedIntSlice of PackedInt(Array/Slice)" { |
| 470 | 476 | } |
| 471 | 477 | |
| 472 | 478 | test "PackedIntSlice accumulating bit offsets" { |
| 479 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 473 | 480 | //bit_offset is u3, so standard debugging asserts should catch |
| 474 | 481 | // anything |
| 475 | 482 | { |
| ... | ... | @@ -497,6 +504,8 @@ test "PackedIntSlice accumulating bit offsets" { |
| 497 | 504 | //@NOTE: As I do not have a big endian system to test this on, |
| 498 | 505 | // big endian values were not tested |
| 499 | 506 | test "PackedInt(Array/Slice) sliceCast" { |
| 507 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 508 | |
| 500 | 509 | const PackedArray = PackedIntArray(u1, 16); |
| 501 | 510 | var packed_array = PackedArray.init([_]u1{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }); |
| 502 | 511 | const packed_slice_cast_2 = packed_array.sliceCast(u2); |
| ... | ... | @@ -537,6 +546,8 @@ test "PackedInt(Array/Slice) sliceCast" { |
| 537 | 546 | } |
| 538 | 547 | |
| 539 | 548 | test "PackedInt(Array/Slice)Endian" { |
| 549 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 550 | |
| 540 | 551 | { |
| 541 | 552 | const PackedArrayBe = PackedIntArrayEndian(u4, .Big, 8); |
| 542 | 553 | var packed_array_be = PackedArrayBe.init([_]u4{ 0, 1, 2, 3, 4, 5, 6, 7 }); |
| ... | ... | @@ -604,6 +615,8 @@ test "PackedInt(Array/Slice)Endian" { |
| 604 | 615 | // after this one is not mapped and will cause a segfault if we |
| 605 | 616 | // don't account for the bounds. |
| 606 | 617 | test "PackedIntArray at end of available memory" { |
| 618 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 619 | |
| 607 | 620 | switch (builtin.os.tag) { |
| 608 | 621 | .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {}, |
| 609 | 622 | else => return, |
| ... | ... | @@ -623,6 +636,8 @@ test "PackedIntArray at end of available memory" { |
| 623 | 636 | } |
| 624 | 637 | |
| 625 | 638 | test "PackedIntSlice at end of available memory" { |
| 639 | if (we_are_testing_this_with_stage1_which_leaks_comptime_memory) return error.SkipZigTest; |
| 640 | |
| 626 | 641 | switch (builtin.os.tag) { |
| 627 | 642 | .linux, .macosx, .ios, .freebsd, .netbsd, .windows => {}, |
| 628 | 643 | else => return, |