From 0bcaa46d0fb0af324fc2991ddcdf3d34c594f741 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Aug 2018 17:28:27 +0200 Subject: 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. --- test/test_fsb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') 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 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(FBV_BITS) || test_fsb(1024); + return test_fsb(CFixBitVec{}) || test_fsb(CBigBitVec{1024}); } -- cgit v1.2.1