diff options
author | David Robillard <d@drobilla.net> | 2022-11-17 12:10:38 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-17 12:11:12 -0500 |
commit | f85870e15491cc98f8a0fa247d79073e98f1694e (patch) | |
tree | 7a14ad94359f472a0a26491b3d3c6ceb1f1ee745 /test | |
parent | 68d02a48ea89d45f16f7901bf46849ea923841c0 (diff) | |
download | zix-f85870e15491cc98f8a0fa247d79073e98f1694e.tar.gz zix-f85870e15491cc98f8a0fa247d79073e98f1694e.tar.bz2 zix-f85870e15491cc98f8a0fa247d79073e98f1694e.zip |
Remove ZixBitset
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/test_headers_cpp.cpp | 1 | ||||
-rw-r--r-- | test/headers/test_headers.c | 1 | ||||
-rw-r--r-- | test/test_bitset.c | 71 |
3 files changed, 0 insertions, 73 deletions
diff --git a/test/cpp/test_headers_cpp.cpp b/test/cpp/test_headers_cpp.cpp index d637988..3fabe6e 100644 --- a/test/cpp/test_headers_cpp.cpp +++ b/test/cpp/test_headers_cpp.cpp @@ -7,7 +7,6 @@ #include "zix/allocator.h" // IWYU pragma: keep #include "zix/attributes.h" // IWYU pragma: keep -#include "zix/bitset.h" // IWYU pragma: keep #include "zix/btree.h" // IWYU pragma: keep #include "zix/bump_allocator.h" // IWYU pragma: keep #include "zix/digest.h" // IWYU pragma: keep diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c index 265c9a2..a610600 100644 --- a/test/headers/test_headers.c +++ b/test/headers/test_headers.c @@ -3,7 +3,6 @@ #include "zix/allocator.h" // IWYU pragma: keep #include "zix/attributes.h" // IWYU pragma: keep -#include "zix/bitset.h" // IWYU pragma: keep #include "zix/btree.h" // IWYU pragma: keep #include "zix/bump_allocator.h" // IWYU pragma: keep #include "zix/digest.h" // IWYU pragma: keep diff --git a/test/test_bitset.c b/test/test_bitset.c deleted file mode 100644 index 67f6567..0000000 --- a/test/test_bitset.c +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014-2020 David Robillard <d@drobilla.net> -// SPDX-License-Identifier: ISC - -#undef NDEBUG - -#include "zix/bitset.h" - -#include <assert.h> -#include <stddef.h> - -#define N_BITS 256U -#define N_ELEMS (ZIX_BITSET_ELEMS(N_BITS)) - -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - -int -main(void) -{ - ZixBitset b[N_ELEMS]; - ZixBitsetTally t[N_ELEMS]; - - zix_bitset_clear(b, t, N_BITS); - assert(zix_bitset_count_up_to(b, t, N_BITS) == 0); - - for (size_t i = 0; i < N_BITS; ++i) { - zix_bitset_set(b, t, i); - assert(zix_bitset_get(b, i)); - - const size_t count = zix_bitset_count_up_to(b, t, N_BITS); - assert(count == i + 1); - } - - for (size_t i = 0; i <= N_BITS; ++i) { - const size_t count = zix_bitset_count_up_to(b, t, i); - assert(count == i); - } - - for (size_t i = 0; i <= N_BITS; ++i) { - if (i < N_BITS) { - zix_bitset_reset(b, t, i); - } - - const size_t count = zix_bitset_count_up_to(b, t, i); - assert(count == 0); - } - - zix_bitset_clear(b, t, N_BITS); - for (size_t i = 0; i < N_BITS; i += 2) { - zix_bitset_set(b, t, i); - - const size_t count = zix_bitset_count_up_to(b, t, i + 1); - const size_t result = MIN(N_BITS / 2, i / 2 + 1); - - assert(count == result); - } - - zix_bitset_clear(b, t, N_BITS); - for (size_t i = 0; i < N_BITS; ++i) { - if (i % 2 == 0) { - zix_bitset_set(b, t, i); - - const size_t count = zix_bitset_count_up_to_if(b, t, i); - const size_t result = MIN(N_BITS / 2, i / 2); - assert(count == result); - } else { - assert(zix_bitset_count_up_to_if(b, t, i) == (size_t)-1); - } - } - - return 0; -} |