From 2aff80ea780ebe49246bbe550f4ec3fb59820207 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 15 Jan 2013 04:07:47 +0000 Subject: [PATCH] [block_t] remove the test.data file before each test. --- unit-tests/block_t.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/unit-tests/block_t.cc b/unit-tests/block_t.cc index 7f02936..43d0d98 100644 --- a/unit-tests/block_t.cc +++ b/unit-tests/block_t.cc @@ -20,6 +20,7 @@ #define BOOST_TEST_MODULE BlockManagerTests #include +#include using namespace std; @@ -31,9 +32,14 @@ namespace { template typename block_manager::ptr create_bm(block_address nr = 1024) { + string const path("./test.data"); + int r = system("rm -f ./test.data"); + if (r < 0) + throw runtime_error("couldn't rm -f ./test.data"); + return typename block_manager::ptr( - new block_manager("./test.data", nr, MAX_HELD_LOCKS, - block_io::READ_WRITE)); + new block_manager(path, nr, MAX_HELD_LOCKS, + block_io::CREATE)); } template