aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/platform_ut.cpp
blob: 9bfbce831523055a9bd1d272149ca1d179c96d24 (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
27
#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_SIZE_T, sizeof(size_t));
        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);