diff options
| author | dam <dam@gudinoff> | 2023-05-25 01:41:08 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-05-25 01:41:08 +0100 |
| commit | 9f198544e4547acca4a73b26da006aa0f78111d1 (patch) | |
| tree | 22412164bccb523da2080be7277a7ef10bb00ecb | |
| parent | 5a56016115bc810b68b8e2bf505763960911343b (diff) | |
| download | task-time-tracker-9f198544e4547acca4a73b26da006aa0f78111d1.tar.zst task-time-tracker-9f198544e4547acca4a73b26da006aa0f78111d1.zip | |
Added some tests to div.
| -rw-r--r-- | Math_Ext.jai | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Math_Ext.jai b/Math_Ext.jai index bfa64fa..5aafbd5 100644 --- a/Math_Ext.jai +++ b/Math_Ext.jai @@ -145,14 +145,17 @@ test_math_ext :: () { set_build_options_dc(.{do_output=false}); errors += test_op("div", cast(s32)S32_MAX, cast(s32)-2, -S32_MAX/2, s32, false, 1); errors += test_op("div", cast(s64)S64_MAX, cast(s32)-2, -S64_MAX/2, s64, false, 1); + errors += test_op("div", cast( s8)15, cast( s8)5, 3, s8, false, 0); + errors += test_op("div", cast( u8)15, cast(s16)7, 2, s16, false, 1); + errors += test_op("div", cast(s16)15, cast(s32)13, 1, s32, false, 2); + errors += test_op("div", cast(u16)100, cast(s64)3, 33, s64, false, 1); + // Test unsigned div. errors += test_op("div", cast( u8) U8_MAX, cast( u8)2, U8_MAX/2, u8, false, 1); errors += test_op("div", cast(u16)U16_MAX, cast( u8)2, U16_MAX/2, u16, false, 1); errors += test_op("div", cast(u32)U32_MAX, cast(u32)2, U32_MAX/2, u32, false, 1); errors += test_op("div", cast(u64)U64_MAX, cast(u32)2, U64_MAX/2, u64, false, 1); - errors += test_op("div", cast( s8)13, cast( s8)4, 3, s8, false, 1); - errors += test_op("div", cast(s16)15, cast(s16)4, 3, s16, false, 3); if errors > 0 print("# Found % %!\n", errors, ifx errors == 1 then "error" else "errors"); else print(" No errors found.\n"); |
