summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-06-19 23:01:10 +0200
committerCarl Hetherington <cth@carlh.net>2022-06-21 18:55:16 +0200
commit1802418f8325813cc7485394c911973bb123b822 (patch)
tree7c3a4c5fb7d028b7188014e0adbc52b7811bf806
parentfe933ebb2c55b4235fcba5d02af2ba91c272fc88 (diff)
Do cleanup of a test more nicely.
-rw-r--r--test/disk_writer_test.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/disk_writer_test.cc b/test/disk_writer_test.cc
index 7b3778b67..7d1df4873 100644
--- a/test/disk_writer_test.cc
+++ b/test/disk_writer_test.cc
@@ -69,13 +69,14 @@ BOOST_AUTO_TEST_CASE (disk_writer_test1)
using namespace boost::filesystem;
using namespace boost::process;
- remove_all ("build/test/disk_writer_test1.disk");
- remove_all ("build/test/disk_writer_test1.partition");
- remove_all ("build/test/disk_writer_test1");
+ Cleanup cl;
path disk = "build/test/disk_writer_test1.disk";
path partition = "build/test/disk_writer_test1.partition";
+ cl.add(disk);
+ cl.add(partition);
+
/* lwext4 has a lower limit of correct ext2 partition sizes it can make; 32Mb
* does not work here: fsck gives errors about an incorrect free blocks count.
*/
@@ -124,6 +125,8 @@ BOOST_AUTO_TEST_CASE (disk_writer_test1)
system ("e2cp " + partition.string() + ":disk_writer_test1/foo build/test/disk_writer_test1_foo_back");
check_file ("build/test/disk_writer_test1/foo", "build/test/disk_writer_test1_foo_back");
+
+ cl.run();
}