lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [4914] Simplify


From: Greg Chicares
Subject: [lmi-commits] [4914] Simplify
Date: Thu, 06 May 2010 15:31:48 +0000

Revision: 4914
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4914
Author:   chicares
Date:     2010-05-06 15:31:48 +0000 (Thu, 06 May 2010)
Log Message:
-----------
Simplify

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/database.cpp
    lmi/trunk/ihs_database.cpp
    lmi/trunk/input_test.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-05-06 14:38:39 UTC (rev 4913)
+++ lmi/trunk/ChangeLog 2010-05-06 15:31:48 UTC (rev 4914)
@@ -25489,3 +25489,16 @@
   input_test.cpp
 Reimplement product_database::GetEntry().
 
+20100506T1438Z <address@hidden> [718]
+
+  dbdict.hpp
+  input_test.cpp
+Further test product_database::GetEntry().
+
+20100506T1531Z <address@hidden> [718]
+
+  database.cpp
+  ihs_database.cpp
+  input_test.cpp
+Simplify.
+

Modified: lmi/trunk/database.cpp
===================================================================
--- lmi/trunk/database.cpp      2010-05-06 14:38:39 UTC (rev 4913)
+++ lmi/trunk/database.cpp      2010-05-06 15:31:48 UTC (rev 4914)
@@ -139,17 +139,8 @@
     LMI_ASSERT(0 == DB_FIRST);
     LMI_ASSERT(DB_FIRST <= k && k < DB_LAST);
     dict_map::const_iterator i = d.find(k);
-    if(i == d.end())
-        {
-        fatal_error()
-            << "Database entity '"
-            << GetDBNames()[k].ShortName
-            << "' not found."
-            << LMI_FLUSH
-            ;
-        }
-
-    return (*i).second;
+    LMI_ASSERT(i != d.end());
+    return i->second;
 }
 
 /// Constrain the value extracted from the database to be scalar--i.e.,

Modified: lmi/trunk/ihs_database.cpp
===================================================================
--- lmi/trunk/ihs_database.cpp  2010-05-06 14:38:39 UTC (rev 4913)
+++ lmi/trunk/ihs_database.cpp  2010-05-06 15:31:48 UTC (rev 4914)
@@ -221,17 +221,8 @@
     LMI_ASSERT(0 == DB_FIRST);
     LMI_ASSERT(DB_FIRST <= k && k < DB_LAST);
     dict_map::const_iterator i = d.find(k);
-    if(i == d.end())
-        {
-        fatal_error()
-            << "Database entity '"
-            << GetDBNames()[k].ShortName
-            << "' not found."
-            << LMI_FLUSH
-            ;
-        }
-
-    return (*i).second;
+    LMI_ASSERT(i != d.end());
+    return i->second;
 }
 
 /// Constrain the value extracted from the database to be scalar--i.e.,

Modified: lmi/trunk/input_test.cpp
===================================================================
--- lmi/trunk/input_test.cpp    2010-05-06 14:38:39 UTC (rev 4913)
+++ lmi/trunk/input_test.cpp    2010-05-06 15:31:48 UTC (rev 4914)
@@ -113,16 +113,13 @@
         ,"Assertion 'DB_FIRST <= k && k < DB_LAST' failed."
         );
 
-    // It is so difficult to contrive a testcase that produces this
-    // diagnostic that the diagnostic seems to have little value:
-    // a simple assertion would probably be better.
     database_entity const e = db.GetEntry(DB_EndtAge);
     DBDictionary::instance().dictionary_[1 + DB_LAST] = e;
     DBDictionary::instance().dictionary_.erase(DB_EndtAge);
     BOOST_TEST_THROW
         (db.GetEntry(DB_EndtAge)
         ,std::runtime_error
-        ,"Database entity 'EndtAge' not found."
+        ,"Assertion 'i != d.end()' failed."
         );
 }
 





reply via email to

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