19 #include <gtest/gtest.h>
29 uint8_t buffer[
sizeof(T)];
31 EXPECT_EQ(value, ReadWriteUtil::GetInt<T>(buffer));
36 TestBigEndian<uint16_t>(0);
37 TestBigEndian<uint16_t>(0xff);
38 TestBigEndian<uint16_t>(0xffff);
40 TestBigEndian<uint32_t>(0);
41 TestBigEndian<uint32_t>(0xff);
42 TestBigEndian<uint32_t>(0xffff);
43 TestBigEndian<uint32_t>(0xffffff);
44 TestBigEndian<uint32_t>(0xffffffff);
46 TestBigEndian<uint64_t>(0);
47 TestBigEndian<uint64_t>(0xff);
48 TestBigEndian<uint64_t>(0xffff);
49 TestBigEndian<uint64_t>(0xffffff);
50 TestBigEndian<uint64_t>(0xffffffff);
51 TestBigEndian<uint64_t>(0xffffffffff);
52 TestBigEndian<uint64_t>(0xffffffffffff);
53 TestBigEndian<uint64_t>(0xffffffffffffff);
58 int main(
int argc,
char **argv) {
60 ::testing::InitGoogleTest(&argc, argv);
61 return RUN_ALL_TESTS();
void TestBigEndian(T value)
static void PutInt(uint8_t *buf, uint16_t integer)
int main(int argc, char **argv)
static void Init()
Initialize CpuInfo.