From ac65326242af579d6e1a7bd71730f1c78c8bde9b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Aug 2018 18:22:26 +0200 Subject: Reorganize headers to make a clear public/private distinction --- test/test_bitvec.cpp | 10 +++++----- test/test_gray_code_rank.cpp | 19 ++++++++++--------- test/test_hilbert.cpp | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'test') diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index 1596042..bd944b5 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -252,13 +252,13 @@ test_gray_code(Context& ctx) { const T v = make_random_bitvec(ctx); T r = v; - gray_code(r); + chilbert::detail::gray_code(r); if (N > 0) { assert(N == 1 || r == (v ^ (v >> 1))); T s = r; - gray_code_inv(s); + chilbert::detail::gray_code_inv(s); assert(s == v); } } @@ -271,11 +271,11 @@ test_comparison(Context&) T b = make_zero_bitvec(); for (size_t bit = 1; bit < N; ++bit) { - set_bit(a, bit, 1); + chilbert::detail::set_bit(a, bit, 1); for (size_t i = 0; i < bit; ++i) { - set_bit(a, i, rand() % 2 == 0); - set_bit(b, i, rand() % 2 == 0); + chilbert::detail::set_bit(a, i, rand() % 2 == 0); + chilbert::detail::set_bit(b, i, rand() % 2 == 0); } assert(b < a); diff --git a/test/test_gray_code_rank.cpp b/test/test_gray_code_rank.cpp index 0c06a33..9c903c1 100644 --- a/test/test_gray_code_rank.cpp +++ b/test/test_gray_code_rank.cpp @@ -21,9 +21,9 @@ #include "chilbert/BoundedBitVec.hpp" #include "chilbert/DynamicBitVec.hpp" -#include "chilbert/GrayCodeRank.hpp" #include "chilbert/SmallBitVec.hpp" #include "chilbert/StaticBitVec.hpp" +#include "chilbert/detail/gray_code_rank.hpp" #include #include @@ -39,7 +39,7 @@ get_mask(const std::array& ms, const size_t d, const size_t step) { T mask = make_zero_bitvec(); size_t b; - chilbert::extract_mask(ms.data(), D, d, step, mask, b); + chilbert::detail::extract_mask(ms.data(), D, d, step, mask, b); assert(b == mask.count()); @@ -75,21 +75,21 @@ test_gray_code_rank(Context& ctx) const auto b = make_random_bitvec(ctx); auto ga = a; - gray_code(ga); + chilbert::detail::gray_code(ga); auto gb = b; - gray_code(gb); + chilbert::detail::gray_code(gb); // Calculate gray code ranks auto ra = make_zero_bitvec(); - chilbert::gray_code_rank(mask, ga, D, ra); + chilbert::detail::gray_code_rank(mask, ga, D, ra); auto rb = make_zero_bitvec(); - chilbert::gray_code_rank(mask, gb, D, rb); + chilbert::detail::gray_code_rank(mask, gb, D, rb); // Ensure ranks have at most mask.count() bits auto max = make_zero_bitvec(); - set_bit(max, mask.count(), 1); + chilbert::detail::set_bit(max, mask.count(), 1); assert(ra < max); assert(rb < max); @@ -102,11 +102,12 @@ test_gray_code_rank(Context& ctx) const auto pat = ~mask; auto ga_out = make_zero_bitvec(); auto gag_out = make_zero_bitvec(); - gray_code_rank_inv(mask, pat, ra, D, mask.count(), gag_out, ga_out); + chilbert::detail::gray_code_rank_inv( + mask, pat, ra, D, mask.count(), gag_out, ga_out); assert((ga_out & mask) == (ga & mask)); auto gag_check = ga_out; - gray_code(gag_check); + chilbert::detail::gray_code(gag_check); assert(gag_check == gag_out); } } diff --git a/test/test_hilbert.cpp b/test/test_hilbert.cpp index a217dc2..307dbae 100644 --- a/test/test_hilbert.cpp +++ b/test/test_hilbert.cpp @@ -21,9 +21,9 @@ #include "chilbert/BoundedBitVec.hpp" #include "chilbert/DynamicBitVec.hpp" -#include "chilbert/Hilbert.hpp" #include "chilbert/SmallBitVec.hpp" #include "chilbert/StaticBitVec.hpp" +#include "chilbert/chilbert.hpp" #include -- cgit v1.2.1