summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2016-12-25 01:50:12 +0100
committerFelix Morgner <felix.morgner@gmail.com>2016-12-25 01:50:12 +0100
commitef8699a4d40608d16e6dbfd978008c9894b8d4d0 (patch)
tree06cc0b27b8835026e55e202ad302f77ed55b2ca7 /test
parent2a323c549554cbe028efd92be55104460388c742 (diff)
downloadextfs-ef8699a4d40608d16e6dbfd978008c9894b8d4d0.tar.xz
extfs-ef8699a4d40608d16e6dbfd978008c9894b8d4d0.zip
project: Add first unit test
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/fs/CMakeLists.txt3
-rw-r--r--test/fs/extfs_test.cpp23
3 files changed, 27 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..8b46378
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(fs)
diff --git a/test/fs/CMakeLists.txt b/test/fs/CMakeLists.txt
new file mode 100644
index 0000000..b1ccc1b
--- /dev/null
+++ b/test/fs/CMakeLists.txt
@@ -0,0 +1,3 @@
+set(CUTE_GROUP "fs")
+
+cute_test(extfs LIBRARIES extfs)
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 <cute/cute.h>
+#include <cute/cute_runner.h>
+#include <cute/ostream_listener.h>
+#include <cute/xml_listener.h>
+
+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<cute::ostream_listener<>> listener{resultFile.out};
+ return !cute::makeRunner(listener, argc, argv)(tests, "fs::extfs tests");
+ }