3 #include "ntp_stdlib.h"
10 //int IsEqual(const vint64 &expected, const vint64 &actual) {
11 int IsEqual(const vint64 expected, const vint64 actual) {
12 if (0 == memcmp(&expected, &actual, sizeof(vint64))) {
13 printf( "%x.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.'
14 printf("%x",expected.D_s.lo);//<< std::hex << expected.D_s.lo
16 printf("%x.",actual.D_s.hi); //<< std::hex << actual.D_s.hi << '.'
17 printf("%x\n",actual.D_s.lo); //<< std::hex << actual.D_s.lo;
22 printf( "%d.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.'
23 printf("%d",expected.D_s.lo);//<< std::hex << expected.D_s.lo
25 printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.hi << '.'
26 printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.lo;
31 // ----------------------------------------------------------------------
33 void test_ParseVUI64_pos() {
41 act = strtouv64(sp, &ep, 0);
43 TEST_ASSERT_TRUE(IsEqual(exp, act));
44 TEST_ASSERT_EQUAL(*ep, 'x');
47 void test_ParseVUI64_neg() {
55 act = strtouv64(sp, &ep, 0);
56 TEST_ASSERT_TRUE(IsEqual(exp, act));
57 TEST_ASSERT_EQUAL(*ep, 'x');
60 void test_ParseVUI64_case() {
65 sp = "0123456789AbCdEf";
66 exp.D_s.hi = 0x01234567;
67 exp.D_s.lo = 0x89ABCDEF;
68 act = strtouv64(sp, &ep, 16);
69 TEST_ASSERT_TRUE(IsEqual(exp, act));
70 TEST_ASSERT_EQUAL(*ep, '\0');