replace non-fatal error messages with ASSERT()'s
authorBrian Norris <banorris@uci.edu>
Thu, 3 May 2012 18:15:47 +0000 (11:15 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 3 May 2012 18:15:47 +0000 (11:15 -0700)
Some errors have been overlooked because they are not 'loud' enough. Use
ASSERT() macro to fail-stop.

model.cc
threads.cc

index 6fea489aa0130fc8e84d2345c9890234f922eedb..e0c16eba8e1ac0677c3a6de32d6e94230d949c37 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -108,8 +108,8 @@ thread_id_t ModelChecker::advance_backtracking_state()
 
        /* Else, we are trying to replay an execution */
        exploring->advance_state();
-       if (exploring->get_state() == NULL)
-               DEBUG("*** error: reached end of backtrack trace\n");
+
+       ASSERT(exploring->get_state() != NULL);
 
        return get_next_replay_thread();
 }
index e0cb277563bb057c989be29379866ac8f090094b..bc553b140fe4df5a1a2a3e39da7b7b1b91644403 100644 (file)
@@ -116,7 +116,7 @@ static int thread_system_next(void)
                        /* Stopped while running; i.e., completed */
                        curr->complete();
                else
-                       DEBUG("ERROR: current thread in unexpected state??\n");
+                       ASSERT(false);
        }
        next = model->scheduler->next_thread();
        if (next)