fix hash test

This commit is contained in:
bolero-MURAKAMI 2013-02-07 23:18:22 +09:00
parent 7aa10d1e08
commit 70b94395d5
2 changed files with 4 additions and 10 deletions

View file

@ -222,11 +222,8 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!sprout::tuples::is_tuple<int>::value); TESTSPR_BOTH_ASSERT(!sprout::tuples::is_tuple<int>::value);
// sprout::to_hash, sprout::hash // sprout::to_hash, sprout::hash
{ TESTSPR_BOTH_ASSERT(sprout::to_hash(tup1) == sprout::hash<decltype(tup1)>()(tup1));
typedef sprout::tuples::tuple<int, int> type; TESTSPR_BOTH_ASSERT(sprout::to_hash(tup1) != sprout::to_hash(sprout::tuples::tuple<int, double>()));
TESTSPR_BOTH_ASSERT(sprout::to_hash(type(1, 2)) == sprout::hash<type>()(type(1, 2)));
TESTSPR_BOTH_ASSERT(sprout::to_hash(type(1, 2)) != sprout::to_hash(type()));
}
} }
} }
} // namespace testspr } // namespace testspr

View file

@ -219,11 +219,8 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!sprout::is_variant<int>::value); TESTSPR_BOTH_ASSERT(!sprout::is_variant<int>::value);
// sprout::to_hash, sprout::hash // sprout::to_hash, sprout::hash
{ TESTSPR_BOTH_ASSERT(sprout::to_hash(var1) == sprout::hash<decltype(var1)>()(var1));
typedef sprout::variant<int, char> type; TESTSPR_BOTH_ASSERT(sprout::to_hash(var1) != sprout::to_hash(sprout::variant<int, double>()));
TESTSPR_BOTH_ASSERT(sprout::to_hash(type(1)) == sprout::hash<type>()(type(1)));
TESTSPR_BOTH_ASSERT(sprout::to_hash(type(1)) != sprout::to_hash(type()));
}
} }
} }
} // namespace testspr } // namespace testspr