/* TestHelper.java */

/* This class is based on code from Arnow and Weiss. */

/** A class with helping functions for writing test code. */
public class TestHelper {
  /** Checks the given condition and prints the error messages
   * if it fails.  If testCondition is true, this method
   *  does nothing; if it is false, the given message is printed
   *  followed by a dump of the program call stack. 
   * @param testCondition the condition to be verified
   * @param message the error message to be printed if the condition 
   *   is not satfisfied.
   */
  static void verify(boolean testCondition, String message) {
    if (!testCondition) {
      System.out.print("*** Error - test failure: ");
      System.out.println(message);
      Thread.dumpStack();
    }
  }
}