Skip to content

Commit

Permalink
Incorporate test/hash_append_2.cpp into append_array.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 25, 2024
1 parent 3f1356d commit 8d6d508
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 91 deletions.
1 change: 0 additions & 1 deletion test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ run detail_reverse.cpp ;

# hash_append

run hash_append_2.cpp ;
run hash_append_3.cpp ;
run hash_append_4.cpp ;
run hash_append_5.cpp ;
Expand Down
20 changes: 9 additions & 11 deletions test/append_array.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
// Copyright 2017 Peter Dimov.
// Copyright 2017, 2024 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
//
// Endian-independent test

#include <boost/hash2/hash_append.hpp>
#include <boost/hash2/fnv1a.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/array.hpp>
#include <array>

template<class Hash, class Flavor, class R> void test( R r )
template<class Hash, class Flavor, class T, class R> void test( R r )
{
Flavor f;

{
unsigned char v[4] = { 1, 2, 3, 4 };
T v[4] = { 1, 2, 3, 4 };

Hash h;

Expand All @@ -28,7 +26,7 @@ template<class Hash, class Flavor, class R> void test( R r )
}

{
unsigned char v[4] = { 1, 2, 3, 4 };
T v[4] = { 1, 2, 3, 4 };

Hash h;

Expand All @@ -38,7 +36,7 @@ template<class Hash, class Flavor, class R> void test( R r )
}

{
unsigned char v[2][2] = { { 1, 2 }, { 3, 4 } };
T v[2][2] = { { 1, 2 }, { 3, 4 } };

Hash h;

Expand All @@ -48,7 +46,7 @@ template<class Hash, class Flavor, class R> void test( R r )
}

{
boost::array<unsigned char, 4> v = {{ 1, 2, 3, 4 }};
boost::array<T, 4> v = {{ 1, 2, 3, 4 }};

Hash h;

Expand All @@ -58,7 +56,7 @@ template<class Hash, class Flavor, class R> void test( R r )
}

{
std::array<unsigned char, 4> v = {{ 1, 2, 3, 4 }};
std::array<T, 4> v = {{ 1, 2, 3, 4 }};

Hash h;

Expand All @@ -72,8 +70,8 @@ int main()
{
using namespace boost::hash2;

test<fnv1a_32, default_flavor>( 1463068797ul );
test<fnv1a_64, default_flavor>( 13725386680924731485ull );
test<fnv1a_32, default_flavor, unsigned char>( 1463068797 );
test<fnv1a_32, little_endian_flavor, int>( 1041505217 );

return boost::report_errors();
}
79 changes: 0 additions & 79 deletions test/hash_append_2.cpp

This file was deleted.

0 comments on commit 8d6d508

Please sign in to comment.