William A. Kennington III | 403cda2 | 2022-12-12 15:52:35 -0800 | [diff] [blame] | 1 | #include <stdplus/hash.hpp> |
| 2 | |
William A. Kennington III | 85149ee | 2023-01-03 18:15:47 -0800 | [diff] [blame] | 3 | #include <array> |
William A. Kennington III | 403cda2 | 2022-12-12 15:52:35 -0800 | [diff] [blame] | 4 | #include <string> |
William A. Kennington III | b07a2eb | 2023-01-03 18:14:40 -0800 | [diff] [blame] | 5 | #include <tuple> |
William A. Kennington III | 403cda2 | 2022-12-12 15:52:35 -0800 | [diff] [blame] | 6 | |
| 7 | #include <gtest/gtest.h> |
| 8 | |
| 9 | namespace stdplus |
| 10 | { |
| 11 | |
| 12 | TEST(HashMulti, Basic) |
| 13 | { |
| 14 | EXPECT_EQ(0, hashMulti()); |
| 15 | EXPECT_EQ(2654435834, hashMulti(1, 2)); |
William A. Kennington III | 85149ee | 2023-01-03 18:15:47 -0800 | [diff] [blame] | 16 | int s[4] = {1, 2, 3, 4}; |
| 17 | std::array<uint16_t, 2> a = {3, 4}; |
William A. Kennington III | b07a2eb | 2023-01-03 18:14:40 -0800 | [diff] [blame] | 18 | std::tuple<std::string, int> t = {"s", 8}; |
William A. Kennington III | 85149ee | 2023-01-03 18:15:47 -0800 | [diff] [blame] | 19 | hashMulti(1, std::string("bacon"), nullptr, s, a, t); |
William A. Kennington III | 403cda2 | 2022-12-12 15:52:35 -0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | } // namespace stdplus |