aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-19 16:47:38 +0200
committerDavid Robillard <d@drobilla.net>2018-09-29 14:49:01 +0200
commit03f39c8be08d632d1f982f5ba5f2e95256be1122 (patch)
tree41ae78da247659bf8261bdd2397fadf32550d2d9 /test
parentfa3d8f677b6a30c2115e7d167d4938e293dfad81 (diff)
downloadchilbert-03f39c8be08d632d1f982f5ba5f2e95256be1122.tar.gz
chilbert-03f39c8be08d632d1f982f5ba5f2e95256be1122.tar.bz2
chilbert-03f39c8be08d632d1f982f5ba5f2e95256be1122.zip
Use consistent naming scheme
Diffstat (limited to 'test')
-rw-r--r--test/test_bitvec.cpp10
-rw-r--r--test/test_gray_code_rank.cpp16
-rw-r--r--test/test_hilbert.cpp12
3 files changed, 19 insertions, 19 deletions
diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp
index b891aca..fdadb19 100644
--- a/test/test_bitvec.cpp
+++ b/test/test_bitvec.cpp
@@ -251,13 +251,13 @@ test_gray_code(Context& ctx)
{
const T v = make_random_bitvec<T, N>(ctx);
T r = v;
- grayCode(r);
+ gray_code(r);
if (N > 0) {
assert(N == 1 || r == (v ^ (v >> 1)));
T s = r;
- grayCodeInv(s);
+ gray_code_inv(s);
assert(s == v);
}
}
@@ -270,11 +270,11 @@ test_comparison(Context&)
T b = make_zero_bitvec<T, N>();
for (size_t bit = 1; bit < N; ++bit) {
- setBit(a, bit, 1);
+ set_bit(a, bit, 1);
for (size_t i = 0; i < bit; ++i) {
- setBit(a, i, rand() % 2 == 0);
- setBit(b, i, rand() % 2 == 0);
+ set_bit(a, i, rand() % 2 == 0);
+ 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 8be40f1..fa3fe3c 100644
--- a/test/test_gray_code_rank.cpp
+++ b/test/test_gray_code_rank.cpp
@@ -38,7 +38,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::extractMask(ms.data(), D, d, step, mask, b);
+ chilbert::extract_mask(ms.data(), D, d, step, mask, b);
assert(b == mask.count());
@@ -74,21 +74,21 @@ test_gray_code_rank(Context& ctx)
const auto b = make_random_bitvec<T, D>(ctx);
auto ga = a;
- grayCode(ga);
+ gray_code(ga);
auto gb = b;
- grayCode(gb);
+ gray_code(gb);
// Calculate gray code ranks
auto ra = make_zero_bitvec<T, D>();
- chilbert::grayCodeRank(mask, ga, D, ra);
+ chilbert::gray_code_rank(mask, ga, D, ra);
auto rb = make_zero_bitvec<T, D>();
- chilbert::grayCodeRank(mask, gb, D, rb);
+ chilbert::gray_code_rank(mask, gb, D, rb);
// Ensure ranks have at most mask.count() bits
auto max = make_zero_bitvec<T, D>();
- setBit(max, mask.count(), 1);
+ set_bit(max, mask.count(), 1);
assert(ra < max);
assert(rb < max);
@@ -101,11 +101,11 @@ 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>();
- grayCodeRankInv(mask, pat, ra, D, mask.count(), gag_out, ga_out);
+ 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;
- grayCode(gag_check);
+ gray_code(gag_check);
assert(gag_check == gag_out);
}
}
diff --git a/test/test_hilbert.cpp b/test/test_hilbert.cpp
index 36a2992..0daf749 100644
--- a/test/test_hilbert.cpp
+++ b/test/test_hilbert.cpp
@@ -106,12 +106,12 @@ test_standard(Context& ctx)
H ha = make_zero_bitvec<H, D * M>();
assert(ha.size() >= D * M);
- chilbert::coordsToIndex(pa.data(), M, D, ha);
+ chilbert::coords_to_index(pa.data(), M, D, ha);
{
// Ensure unmapping results in the original point
auto pa_out = make_random_point<M, D>(ctx);
- chilbert::indexToCoords(pa_out.data(), M, D, ha);
+ chilbert::index_to_coords(pa_out.data(), M, D, ha);
assert(pa_out == pa);
}
@@ -124,7 +124,7 @@ test_standard(Context& ctx)
// Unmap next hilbert index to a point
auto pb = make_random_point<M, D>(ctx);
- chilbert::indexToCoords(pb.data(), M, D, hb);
+ chilbert::index_to_coords(pb.data(), M, D, hb);
// Ensure next point is 1 unit of distance away from first
assert(squared_distance(pa, pb) == 1);
@@ -142,12 +142,12 @@ test_compact(Context& ctx)
T ha = make_zero_bitvec<T, D * M>();
assert(ha.size() >= D * M);
- chilbert::coordsToCompactIndex(pa.data(), ms.data(), D, ha);
+ chilbert::coords_to_compact_index(pa.data(), ms.data(), D, ha);
{
// Ensure unmapping results in the original point
auto pa_out = make_random_point<M, D>(ctx);
- chilbert::compactIndexToCoords(pa_out.data(), ms.data(), D, ha);
+ chilbert::compact_index_to_coords(pa_out.data(), ms.data(), D, ha);
assert(pa_out == pa);
}
@@ -160,7 +160,7 @@ test_compact(Context& ctx)
// Unmap next hilbert index to a point
auto pb = make_random_point<M, D>(ctx);
- chilbert::compactIndexToCoords(pb.data(), ms.data(), D, hb);
+ chilbert::compact_index_to_coords(pb.data(), ms.data(), D, hb);
// Ensure next point is 1 unit of distance away from first
assert(squared_distance(pa, pb) == 1);