6 guint32 a = 0xabcdef01, res32;
7 guint64 b = (((guint64)a) << 32) | a, res64;
8 guint64 b_expect = (((guint64)0x1efcdab) << 32) | 0x01efcdab;
9 guint16 c = 0xabcd, res16;
11 res32 = GUINT32_SWAP_LE_BE (a);
12 if (res32 != 0x01efcdab)
13 return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
14 res32 = GUINT32_SWAP_LE_BE (1);
15 if (res32 != 0x1000000)
16 return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32);
18 res64 = GUINT64_SWAP_LE_BE(b);
19 if (res64 != b_expect)
20 return FAILED ("GUINT64_SWAP_LE_BE returned 0x%llx (had=0x%llx)", res64, b);
21 res16 = GUINT16_SWAP_LE_BE(c);
23 return FAILED ("GUINT16_SWAP_LE_BE returned 0x%x", (guint32) res16);
32 static Test endian_tests [] = {
37 DEFINE_TEST_GROUP_INIT(endian_tests_init, endian_tests)