platform_ut.cpp 1004 B

1234567891011121314151617181920212223242526
  1. #include "platform.h"
  2. #include <library/cpp/testing/unittest/registar.h>
  3. class TPlatformTest: public TTestBase {
  4. UNIT_TEST_SUITE(TPlatformTest);
  5. UNIT_TEST(TestSizeOf)
  6. UNIT_TEST_SUITE_END();
  7. private:
  8. inline void TestSizeOf() {
  9. UNIT_ASSERT_EQUAL(SIZEOF_PTR, sizeof(void*));
  10. UNIT_ASSERT_EQUAL(SIZEOF_CHAR, sizeof(char));
  11. UNIT_ASSERT_EQUAL(SIZEOF_SHORT, sizeof(short));
  12. UNIT_ASSERT_EQUAL(SIZEOF_INT, sizeof(int));
  13. UNIT_ASSERT_EQUAL(SIZEOF_LONG, sizeof(long));
  14. UNIT_ASSERT_EQUAL(SIZEOF_LONG_LONG, sizeof(long long));
  15. UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_CHAR, sizeof(unsigned char));
  16. UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_INT, sizeof(unsigned int));
  17. UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_LONG, sizeof(unsigned long));
  18. UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_LONG_LONG, sizeof(unsigned long long));
  19. UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_SHORT, sizeof(unsigned short));
  20. }
  21. };
  22. UNIT_TEST_SUITE_REGISTRATION(TPlatformTest);