Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 1 | #include <sdbusplus/utility/tuple_to_array.hpp> |
Patrick Venture | 95269db | 2018-08-31 09:19:17 -0700 | [diff] [blame] | 2 | |
Patrick Williams | 608b5bc | 2017-04-28 16:00:19 -0500 | [diff] [blame] | 3 | #include <gtest/gtest.h> |
Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 4 | |
Patrick Williams | 608b5bc | 2017-04-28 16:00:19 -0500 | [diff] [blame] | 5 | TEST(TupleToArray, Test3Chars) |
Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 6 | { |
| 7 | std::array<char, 3> a{'a', 'b', 'c'}; |
| 8 | auto t = std::make_tuple('a', 'b', 'c'); |
| 9 | |
Patrick Williams | 608b5bc | 2017-04-28 16:00:19 -0500 | [diff] [blame] | 10 | ASSERT_EQ(a, sdbusplus::utility::tuple_to_array(std::move(t))); |
| 11 | } |
Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 12 | |
Patrick Williams | 608b5bc | 2017-04-28 16:00:19 -0500 | [diff] [blame] | 13 | TEST(TupleToArray, Test4Ints) |
| 14 | { |
Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 15 | std::array<int, 4> b{1, 2, 3, 4}; |
| 16 | auto t2 = std::make_tuple(1, 2, 3, 4); |
| 17 | |
Patrick Williams | 608b5bc | 2017-04-28 16:00:19 -0500 | [diff] [blame] | 18 | ASSERT_EQ(b, sdbusplus::utility::tuple_to_array(std::move(t2))); |
Patrick Williams | 4dbdef7 | 2016-07-20 12:36:56 -0500 | [diff] [blame] | 19 | } |