diff options
author | David Robillard <d@drobilla.net> | 2018-08-07 17:28:27 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:45:39 +0200 |
commit | 0bcaa46d0fb0af324fc2991ddcdf3d34c594f741 (patch) | |
tree | d8b88814da73b82980a25d0548ac6c0b823dbdc8 /test | |
parent | 1f689397601b53f51f7be973f8f952d0dec408da (diff) | |
download | chilbert-0bcaa46d0fb0af324fc2991ddcdf3d34c594f741.tar.gz chilbert-0bcaa46d0fb0af324fc2991ddcdf3d34c594f741.tar.bz2 chilbert-0bcaa46d0fb0af324fc2991ddcdf3d34c594f741.zip |
Raise responsibility of allocating scratch
Use copy constructors instead of size-based initialization in deeper methods
instead. This avoids the assumption that the types take a dynamic size
parameter.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_fsb.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_fsb.cpp b/test/test_fsb.cpp index 473438f..c55d9cb 100644 --- a/test/test_fsb.cpp +++ b/test/test_fsb.cpp @@ -26,11 +26,11 @@ using namespace chilbert; template <typename T> int -test_fsb(const int size) +test_fsb(const T& empty_field) { - for (int i = 0; i < size; ++i) { - T field{size}; - field.reset(); + assert(empty_field.none()); + for (int i = 0; i < empty_field.size(); ++i) { + T field = empty_field; field.set(i); assert(field.fsb() == i + 1); } @@ -41,5 +41,5 @@ test_fsb(const int size) int main() { - return test_fsb<CFixBitVec>(FBV_BITS) || test_fsb<CBigBitVec>(1024); + return test_fsb(CFixBitVec{}) || test_fsb(CBigBitVec{1024}); } |