]> git.stg.codes - stg.git/blobdiff - tests/test_conffiles.cpp
Merge remote-tracking branch 'github/master'
[stg.git] / tests / test_conffiles.cpp
index 897148f5b9224009e9b96eca423aed305b544306..5936ad36552456c5bbbdefb304e80596554405ed 100644 (file)
@@ -3,9 +3,9 @@
 #include <string>
 #include <fstream>
 
-#include <tut/tut.hpp>
+#include "tut/tut.hpp"
 
-#include "conffiles.h"
+#include "stg/conffiles.h"
 
 namespace tut
 {
@@ -28,9 +28,11 @@ namespace tut
 
             ensure_equals("Correct construction", cf.Error(), 0);
 
-            ensure_equals("Correct writing 'a' string", cf.WriteString("a", "a-string"), 0);
-            ensure_equals("Correct writing 'b' integer (0)", cf.WriteInt("b", 0), 0);
-            ensure_equals("Correct writing 'e' double (2.718281828)", cf.WriteDouble("e", 2.718281828), 0);
+            cf.WriteString("a", "a-string");
+            cf.WriteInt("b", 0);
+            cf.WriteDouble("e", 2.718281828);
+
+            ensure_equals("Correct data flushing", cf.Flush(), 0);
         }
 
         {
@@ -60,9 +62,9 @@ namespace tut
         set_test_name("Check empty lines and comments");
 
         {
-            ofstream f("/tmp/test.cf");
+            std::ofstream f("/tmp/test.cf");
 
-            ensure("Correct construction (part 3)", f);
+            ensure("Correct construction (part 3)", static_cast<bool>(f));
 
             f << "\n"
               << "a=a-string# a string\n"