From f0e738028819ac988dbd825cf1962188c9e5cdc3 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 12 Sep 2023 03:32:35 +0200 Subject: cleanup --- include/kit.inl.h | 7 ------- source/kit/bigint.h | 8 -------- source/tests/bigint.test.c | 8 ++++++++ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/kit.inl.h b/include/kit.inl.h index e16762b..b83e55c 100644 --- a/include/kit.inl.h +++ b/include/kit.inl.h @@ -801,13 +801,6 @@ extern "C" { #ifndef KIT_BIGINT_SIZE # 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/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); } -- cgit v1.2.3