diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-12 03:32:35 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-12 03:32:35 +0200 |
commit | f0e738028819ac988dbd825cf1962188c9e5cdc3 (patch) | |
tree | e7876388cbe6771ddbfe22841a51bf704f864137 /source | |
parent | 503219af891858cba983d9b2ecd22ca50498001f (diff) | |
download | kit-f0e738028819ac988dbd825cf1962188c9e5cdc3.zip |
cleanup
Diffstat (limited to 'source')
-rw-r--r-- | source/kit/bigint.h | 8 | ||||
-rw-r--r-- | source/tests/bigint.test.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/kit/bigint.h b/source/kit/bigint.h index 9f9ba16..be831b7 100644 --- a/source/kit/bigint.h +++ b/source/kit/bigint.h @@ -14,14 +14,6 @@ extern "C" { # define KIT_BIGINT_SIZE 64 #endif -#if __STDC_VERSION__ >= 199901L -static_assert(sizeof(u8) == 1, "u8 size should be 1 byte"); -static_assert(sizeof(u32) == 4, "u32 size should be 4 bytes"); -static_assert(sizeof(u64) == 8, "u64 size should be 8 bytes"); -static_assert(KIT_BIGINT_SIZE > 0 && (KIT_BIGINT_SIZE % 8) == 0, - "Invalid big integer size"); -#endif - typedef struct { u32 v[KIT_BIGINT_SIZE / 4]; } kit_bigint_t; diff --git a/source/tests/bigint.test.c b/source/tests/bigint.test.c index 94fd9ef..3e55c39 100644 --- a/source/tests/bigint.test.c +++ b/source/tests/bigint.test.c @@ -5,6 +5,14 @@ #include "../kit/kit_test.h" TEST("bigint size check") { + REQUIRE_EQ(sizeof(u8), 1); + REQUIRE_EQ(sizeof(u16), 2); + REQUIRE_EQ(sizeof(u32), 4); + REQUIRE_EQ(sizeof(u64), 8); + REQUIRE_EQ(sizeof(i8), 1); + REQUIRE_EQ(sizeof(i16), 2); + REQUIRE_EQ(sizeof(i32), 4); + REQUIRE_EQ(sizeof(i64), 8); REQUIRE_EQ(sizeof(bigint_t), 256); } |