// Copyright 2017, 2024 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include #include #include template void test( T1 const& t1, T2 const& t2 ) { Flavor f; Hash h1; boost::hash2::hash_append( h1, f, t1 ); Hash h2; boost::hash2::hash_append( h2, f, t2 ); BOOST_TEST_EQ( h1.result(), h2.result() ); } int main() { using namespace boost::hash2; test( std::tuple<>(), std::array() ); test( std::tuple( '\x01' ), std::array{{ '\x01' }} ); test( std::tuple( '\x01', '\x02' ), std::array{{ '\x01', '\x02' }} ); test( std::tuple( '\x01', '\x02', '\x03' ), std::array{{ '\x01', '\x02', '\x03' }} ); test( std::tuple( '\x01', '\x02', '\x03', '\x04' ), std::array{{ '\x01', '\x02', '\x03', '\x04' }} ); test( std::tuple( '\x01', '\x02', '\x03', '\x04', '\x05' ), std::array{{ '\x01', '\x02', '\x03', '\x04', '\x05' }} ); test( std::tuple( '\x01', '\x02', '\x03', '\x04', '\x05', '\x06' ), std::array{{ '\x01', '\x02', '\x03', '\x04', '\x05', '\x06' }} ); test( std::tuple<>(), std::array() ); test( std::tuple( 1 ), std::array{{ 1 }} ); test( std::tuple( 1, 2 ), std::array{{ 1, 2 }} ); test( std::tuple( 1, 2, 3 ), std::array{{ 1, 2, 3 }} ); test( std::tuple( 1, 2, 3, 4 ), std::array{{ 1, 2, 3, 4 }} ); test( std::tuple( 1, 2, 3, 4, 5 ), std::array{{ 1, 2, 3, 4, 5 }} ); test( std::tuple( 1, 2, 3, 4, 5, 6 ), std::array{{ 1, 2, 3, 4, 5, 6 }} ); return boost::report_errors(); }