return c;
}
+/* and one to do two ints */
+
+static_inline afs_uint32
+opr_jhash_int2(afs_uint32 a, afs_uint32 b, afs_uint32 initval)
+{
+ afs_uint32 c;
+
+ a += 0xdeadbeef + 8 + initval;
+ b += 0xdeadbeef + 8 + initval;
+ c = 0xdeadbeef + 8 + initval;
+ opr_jhash_final(a, b, c);
+
+ return c;
+}
+
static_inline afs_uint32
opr_jhash_opaque(const void *val, size_t length, afs_uint32 initval)
{
int
main(int argc, char **argv)
{
- plan(11);
+ plan(13);
uint32_t test[] = {3526055646UL, 2064483663UL, 3234460805UL, 3963629775UL};
is_int(256, opr_jhash_size(8), "opr_jhash_size returns expected value");
is_int(1100796964, opr_jhash_int(test[0], 0),
"single value works through jhash_int");
+ is_int(3704403432, opr_jhash(test, 2, 0),
+ "Hashing two values works");
+ is_int(3704403432, opr_jhash_int2(test[0], test[1], 0),
+ "jhash_int2 gives same result");
+
is_int(0xdeadbeef, opr_jhash_opaque("", 0, 0),
"Hashing an empty string works");