aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/platform_ut.cpp
blob: 559a6219aa12a040fa54fdd4c7e598cf5fbc87a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "platform.h"

#include <library/cpp/testing/unittest/registar.h>

class TPlatformTest: public TTestBase {
    UNIT_TEST_SUITE(TPlatformTest);
    UNIT_TEST(TestSizeOf)
    UNIT_TEST_SUITE_END();

private:
    inline void TestSizeOf() {
        UNIT_ASSERT_EQUAL(SIZEOF_PTR, sizeof(void*));
        UNIT_ASSERT_EQUAL(SIZEOF_CHAR, sizeof(char));
        UNIT_ASSERT_EQUAL(SIZEOF_SHORT, sizeof(short));
        UNIT_ASSERT_EQUAL(SIZEOF_INT, sizeof(int));
        UNIT_ASSERT_EQUAL(SIZEOF_LONG, sizeof(long));
        UNIT_ASSERT_EQUAL(SIZEOF_LONG_LONG, sizeof(long long));
        UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_CHAR, sizeof(unsigned char));
        UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_INT, sizeof(unsigned int));
        UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_LONG, sizeof(unsigned long));
        UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_LONG_LONG, sizeof(unsigned long long));
        UNIT_ASSERT_EQUAL(SIZEOF_UNSIGNED_SHORT, sizeof(unsigned short));
    }
};

UNIT_TEST_SUITE_REGISTRATION(TPlatformTest);