~jheiss/galera/galera

« back to all changes in this revision

Viewing changes to galerautils/tests/gu_fnv_test.c

  • Committer: Alex Yurchenko
  • Date: 2012-01-16 03:54:07 UTC
  • mto: This revision was merged to the branch mainline in revision 109.
  • Revision ID: ayurchen@void-20120116035407-fnlisz8pubqxh1m5
References lp:915499, lp:907071 - synced with SVN r2671

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
START_TEST (gu_fnv128_test)
35
35
{
36
 
    uint128_t ret = 0;
 
36
    gu_uint128_t GU_SET128(ret, 0, 0);
37
37
    gu_fnv128a (test_buf, strlen(test_buf), &ret);
38
 
    fail_if (GU_FNV128_SEED != ret,
 
38
#if (GU_WORDSIZE == 64)
 
39
    fail_if (!GU_EQ128(GU_FNV128_SEED, ret),
39
40
             "FNV128 failed: expected %"PRIx64" %"PRIx64", got %"PRIx64" %"PRIx64,
40
41
             (uint64_t)(GU_FNV128_SEED >> 64), (uint64_t)GU_FNV128_SEED,
41
42
             (uint64_t)(ret >> 64), (uint64_t)ret);
 
43
#else
 
44
    fail_if (!GU_EQ128(GU_FNV128_SEED, ret),
 
45
             "FNV128 failed: expected %"PRIx64" %"PRIx64", got %"PRIx64" %"PRIx64,
 
46
             GU_FNV128_SEED.u64[GU_64HI], GU_FNV128_SEED.u64[GU_64LO],
 
47
             ret.u64[GU_64HI], ret.u64[GU_64LO]);
 
48
#endif
42
49
}
43
50
END_TEST
44
51