From 874e8192a477ea2c85d9500f19d98c9c306ec471 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Sun, 1 Apr 2007 22:00:53 +0000 Subject: [PATCH] Changed csvdiff so that it would care about the header information, and fail a test the headers are different. Note, I am using this information to put the iteration count. --- tools/testtools/csvdiff.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testtools/csvdiff.cpp b/tools/testtools/csvdiff.cpp index beade6cc7..b90e6a116 100644 --- a/tools/testtools/csvdiff.cpp +++ b/tools/testtools/csvdiff.cpp @@ -760,12 +760,14 @@ int main(int argc, char *argv[]) if (nTitleLines1 != nTitleLines2) { printf("Number o Title Lines differ:, %d %d\n",nTitleLines1, nTitleLines2); + testPassed = 0; } else if (Debug_Flag) { printf("Number of Title Lines in each file = %d\n", nTitleLines1); } if (nColTitleLines1 != nColTitleLines2) { printf("Number of Column title lines differ:, %d %d\n", nColTitleLines1, nColTitleLines2); + testPassed = 0; } else if (Debug_Flag) { printf("Number of column title lines in each file = %d\n", nColTitleLines1); } @@ -793,6 +795,7 @@ int main(int argc, char *argv[]) for (i = 0; i < n; i++) { if (strcmp(title1[i], title2[i]) != 0) { printf("Title Line %d differ:\n\t\"%s\"\n\t\"%s\"\n", i, title1[i], title2[i]); + testPassed = 0; } else if (Debug_Flag) { printf("Title Line %d for each file: \"%s\"\n", i, title1[i]); } @@ -800,20 +803,19 @@ int main(int argc, char *argv[]) if (nTitleLines1 != nTitleLines2) { printf("Number of Title Lines differ: %d %d\n", nTitleLines1, nTitleLines2); testPassed = -1; - exit(-1); } } else { if (nTitleLines1 != nTitleLines2) { if (nTitleLines1) { printf("Titles differ: title for first file: \"%s\"\n", title1[0]); + testPassed = 0; } if (nTitleLines2) { printf("Titles differ: title for second file: \"%s\"\n", title2[0]); } testPassed = -1; - exit(-1); } } @@ -826,6 +828,7 @@ int main(int argc, char *argv[]) printf("Number of column variables differ:, %d %d\n", nCol1, nCol2); mixed_var = TRUE; + testPassed = 0; } else if (Debug_Flag) { printf("Number of column variables in both files = %d\n", nCol1); @@ -862,6 +865,7 @@ int main(int argc, char *argv[]) if (!found) { printf("csvdiff WARNING Variable %s (%d) in first file not found" " in second file\n", ColNames1[i], i); + testPassed = 0; } } for (j = 0; j < nCol2; j++) { @@ -873,6 +877,7 @@ int main(int argc, char *argv[]) printf("csvdiff WARNING Variable %s (%d) in second file " "not found in first file\n", ColNames2[j], j); + testPassed = 0; } }