]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Makefile.am:
authorDamir Tomic <viperus@ntp.org>
Fri, 19 Jun 2015 21:15:36 +0000 (23:15 +0200)
committerDamir Tomic <viperus@ntp.org>
Fri, 19 Jun 2015 21:15:36 +0000 (23:15 +0200)
  added some clean and distclean stuff
c_fileHandlingTest.h:
  added more debug printfs
kodFile.c:
  changed CreatePath so new files are written in a writeable directory

bk: 55848678PgOoh3X8KTDDLTQ06jKSNg

sntp/tests/Makefile.am
sntp/tests/c_fileHandlingTest.h
sntp/tests/kodFile.c
sntp/tests/run-kodFile.c

index d8e02974888b84a07fc11ef4c5bde4400bff7392..b9180c901d116f25a638e3de11c388e1dd1bba4b 100644 (file)
@@ -1,6 +1,7 @@
 NULL =
 BUILT_SOURCES =
-CLEANFILES =
+CLEANFILES = kod-output-blank kod-output-single kod-output-multiple
+DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple
 EXTRA_PROGRAMS =
 
 run_unity =    cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
index e3f76d5707c47673d1e51b96dd36f81c159474d8..cd1756d7ef7cfffd99e239fa95aaa96a87e2c366 100644 (file)
@@ -47,7 +47,7 @@ const char * CreatePath(const char* filename, enum DirectoryType argument) {
                strcpy(path,"../../../../sntp/tests/data/");
        }
 
-       
+       //strcpy(path,"");
        strcat(path,filename);
        printf("PATH IS : %s\n",path);
        return path;
index feb6488944a3c3fc985399a6c6a85ac7c6862188..ceacf2fd33c292b5f690834b0f18580cbaafa2dc 100644 (file)
@@ -74,8 +74,9 @@ void test_ReadFileWithBlankLines() {
 }
 
 void test_WriteEmptyFile() {
-       kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR));
-           printf("kod PATH: %s\n",kod_db_file);
+       //kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR));
+       kod_db_file = estrdup("kod-output-blank");
+          printf("kod PATH: %s\n",kod_db_file);
        write_kod_db();
 
        // Open file and ensure that the filesize is 0 bytes.
@@ -89,7 +90,8 @@ void test_WriteEmptyFile() {
 }
 
 void test_WriteFileWithSingleEntry() {
-       kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR));
+       //kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR));
+       kod_db_file = estrdup("kod-output-single");
     printf("kod PATH: %s\n",kod_db_file);
        add_entry("host1", "DENY");
 
@@ -112,7 +114,8 @@ void test_WriteFileWithSingleEntry() {
 }
 
 void test_WriteFileWithMultipleEntries() {
-       kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR));
+       //kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR));
+       kod_db_file = estrdup("kod-output-multiple");
     printf("kod PATH: %s\n",kod_db_file);
        add_entry("example.com", "RATE");
        add_entry("192.0.2.1", "DENY");
index 87b825d857bc9048c7075dbfc33537089f4fa19d..9c5896263ee07e9599f2bcf42c6282b87b102929 100644 (file)
@@ -54,8 +54,8 @@ int main(int argc, char *argv[])
   RUN_TEST(test_ReadCorrectFile, 35);
   RUN_TEST(test_ReadFileWithBlankLines, 53);
   RUN_TEST(test_WriteEmptyFile, 76);
-  RUN_TEST(test_WriteFileWithSingleEntry, 91);
-  RUN_TEST(test_WriteFileWithMultipleEntries, 114);
+  RUN_TEST(test_WriteFileWithSingleEntry, 92);
+  RUN_TEST(test_WriteFileWithMultipleEntries, 116);
 
   return (UnityEnd());
 }