lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 54532a4 1/3: Compare binary as well as text i


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 54532a4 1/3: Compare binary as well as text in rate-table validation
Date: Sun, 11 Dec 2016 23:42:47 +0000 (UTC)

branch: master
commit 54532a43058d7d10666c4736f5efffcf7ff7caf8
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Compare binary as well as text in rate-table validation
    
    validate() already did this chain of conversions:
      bin0 --> txt1 --> bin2 --> txt3
    and compared txt1 to txt3; now, bin0 and bin2 are also compared.
    This additional comparison finds additional flaws--see:
      http://lists.nongnu.org/archive/html/lmi/2016-12/msg00026.html
---
 rate_table_tool.cpp |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/rate_table_tool.cpp b/rate_table_tool.cpp
index c0cb113..95cccc7 100644
--- a/rate_table_tool.cpp
+++ b/rate_table_tool.cpp
@@ -340,7 +340,16 @@ int verify(fs::path const& database_filename)
                     << LMI_FLUSH
                     ;
                 }
-
+            if(new_table != orig_table)
+                {
+                // This is not really fatal, it is only used here to throw an
+                // exception in a convenient way.
+                fatal_error()
+                    << "After loading and saving the original table '\n"
+                    << "binary contents differed.\n"
+                    << LMI_FLUSH
+                    ;
+                }
             }
         catch(std::exception const& e)
             {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]