diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ff59666..5903c99 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,8 +2,7 @@ set(CMAKE_CXX_STANDARD 98) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(ulib_test - src/ulib/sigslot/sigslot_test.cpp) - + src/ulib/base/types_test.cpp) target_link_libraries(ulib_test PRIVATE ulib gtest diff --git a/tests/src/ulib/base/types_test.cpp b/tests/src/ulib/base/types_test.cpp new file mode 100644 index 0000000..4189275 --- /dev/null +++ b/tests/src/ulib/base/types_test.cpp @@ -0,0 +1,27 @@ +// +// Created by tqcq on 2023/12/5. +// + +#include +#include + +TEST(ULIB_BASE_TYPES, SIZE_OF) +{ + EXPECT_EQ(sizeof(ulib::int8_t), sizeof(char)); + EXPECT_EQ(sizeof(ulib::int16_t), sizeof(short)); + EXPECT_EQ(sizeof(ulib::int32_t), sizeof(int)); + EXPECT_EQ(sizeof(ulib::int64_t), sizeof(long long)); + EXPECT_EQ(sizeof(ulib::uint8_t), sizeof(unsigned char)); + EXPECT_EQ(sizeof(ulib::uint16_t), sizeof(unsigned short)); + EXPECT_EQ(sizeof(ulib::uint32_t), sizeof(unsigned int)); + EXPECT_EQ(sizeof(ulib::uint64_t), sizeof(unsigned long long)); + + EXPECT_EQ(sizeof(ulib::int8_t), 1); + EXPECT_EQ(sizeof(ulib::int16_t), 2); + EXPECT_EQ(sizeof(ulib::int32_t), 4); + EXPECT_EQ(sizeof(ulib::int64_t), 8); + EXPECT_EQ(sizeof(ulib::uint8_t), 1); + EXPECT_EQ(sizeof(ulib::uint16_t), 2); + EXPECT_EQ(sizeof(ulib::uint32_t), 4); + EXPECT_EQ(sizeof(ulib::uint64_t), 8); +} \ No newline at end of file