From 3fa3330cbb986f8256920e3cb9875dc8bc63a9f8 Mon Sep 17 00:00:00 2001
From: Giovanna Lazzari Miotto <giovanna.lazzari.miotto@cern.ch>
Date: Fri, 30 Aug 2024 11:14:25 +0200
Subject: [PATCH] uncomment flush again, change seed

---
 test/testing_scripts/creat_test.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/testing_scripts/creat_test.cpp b/test/testing_scripts/creat_test.cpp
index b2c237d2..a0106ba5 100644
--- a/test/testing_scripts/creat_test.cpp
+++ b/test/testing_scripts/creat_test.cpp
@@ -30,7 +30,7 @@ int main(int argc, char *argv[]) {
   auto filepath = path + filename;
   unsigned int length = atoi(argv[3]);
 
-  srand(506);
+  srand(666);
 
   char *data = (char *)malloc((length) * sizeof(char));
   if (data == NULL) {
@@ -58,10 +58,10 @@ int main(int argc, char *argv[]) {
     if (write_rc != length) {
       std::cout << "write() call returned wrong value rc=" << std::to_string(write_rc) << std::endl;
     } else {
-//      if (fsync(fd) != 0) {
-//        std::cout << "write's fsync() failed errno=" << std::to_string(errno) << std::endl;
-//      }
-//      close(fd);
+      if (fsync(fd) != 0) {
+        std::cout << "write's fsync() failed errno=" << std::to_string(errno) << std::endl;
+      }
+      close(fd);
       std::cout << "sys open / write ran without failure" << std::endl;
     }
   }
@@ -79,10 +79,10 @@ int main(int argc, char *argv[]) {
       std::cout << "fwrite() call returned wrong value rc=" << std::to_string(fwrite_rc)
                 << std::endl;
     } else {
-//      if (fflush(stream_file) != 0) {
-//        std::cout << "fwrite's fflush() failed with errno=" << std::to_string(errno) << std::endl;
-//      }
-//      fclose(stream_file);
+      if (fflush(stream_file) != 0) {
+        std::cout << "fwrite's fflush() failed with errno=" << std::to_string(errno) << std::endl;
+      }
+      fclose(stream_file);
       std::cout << "fopen / fwrite ran without failure" << std::endl;
     }
   }
-- 
GitLab