From ef8699a4d40608d16e6dbfd978008c9894b8d4d0 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 25 Dec 2016 01:50:12 +0100 Subject: project: Add first unit test --- test/fs/extfs_test.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/fs/extfs_test.cpp (limited to 'test/fs/extfs_test.cpp') diff --git a/test/fs/extfs_test.cpp b/test/fs/extfs_test.cpp new file mode 100644 index 0000000..4a5e1b5 --- /dev/null +++ b/test/fs/extfs_test.cpp @@ -0,0 +1,23 @@ +#include "fs/extfs.hpp" + +#include +#include +#include +#include + +void construction_with_inexistent_file_creates_extfs_that_is_not_open() + { + auto && disk = fs::extfs{"./THIS_DISK_DOES_NOT_EXIST"}; + ASSERT(!disk.open()); + } + +int main(int argc, char * argv[]) + { + auto tests = cute::suite{ + CUTE(construction_with_inexistent_file_creates_extfs_that_is_not_open), + }; + + cute::xml_file_opener resultFile{argc, argv}; + cute::xml_listener> listener{resultFile.out}; + return !cute::makeRunner(listener, argc, argv)(tests, "fs::extfs tests"); + } -- cgit v1.2.3