diff options
author | David Robillard <d@drobilla.net> | 2018-08-19 18:22:26 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:50:07 +0200 |
commit | ac65326242af579d6e1a7bd71730f1c78c8bde9b (patch) | |
tree | ae5225c4b9856b3e5d454378d00867d9b0c53d26 /test | |
parent | 7567f77828ff9661f85eabe3b4cfb1876b307d42 (diff) | |
download | chilbert-ac65326242af579d6e1a7bd71730f1c78c8bde9b.tar.gz chilbert-ac65326242af579d6e1a7bd71730f1c78c8bde9b.tar.bz2 chilbert-ac65326242af579d6e1a7bd71730f1c78c8bde9b.zip |
Reorganize headers to make a clear public/private distinction
Diffstat (limited to 'test')
-rw-r--r-- | test/test_bitvec.cpp | 10 | ||||
-rw-r--r-- | test/test_gray_code_rank.cpp | 19 | ||||
-rw-r--r-- | test/test_hilbert.cpp | 2 |
3 files changed, 16 insertions, 15 deletions
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<T, N>(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<T, N>(); 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 <algorithm> #include <array> @@ -39,7 +39,7 @@ get_mask(const std::array<size_t, D>& ms, const size_t d, const size_t step) { T mask = make_zero_bitvec<T, D>(); 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<T, D>(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<T, D>(); - chilbert::gray_code_rank(mask, ga, D, ra); + chilbert::detail::gray_code_rank(mask, ga, D, ra); auto rb = make_zero_bitvec<T, D>(); - 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<T, D>(); - 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<T, D>(); auto gag_out = make_zero_bitvec<T, D>(); - 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 <gmpxx.h> |