lejos.util
Class Assertion

java.lang.Object
  extended by lejos.util.Assertion

public class Assertion
extends Object

Class used in debugging to test assertions. Implementation is platform dependent. For example the unix_impl version will print the string and throw an error if an assertion fails. The rcx_impl version will only throw an error.

Author:
Paul Andrews

Constructor Summary
Assertion()
           
 
Method Summary
static void test(String s, boolean flag)
           
static void testEQ(String s, int expected, int was)
          If the actual value is not equal to the expected value, throw an Error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assertion

public Assertion()
Method Detail

test

public static void test(String s,
                        boolean flag)
Parameters:
s - A string that may be printed along with any other error text.
flag - if true then an Error will be thrown, otherwise nothing will happend.
Throws:
Error - if 'flag' is false.

testEQ

public static void testEQ(String s,
                          int expected,
                          int was)
If the actual value is not equal to the expected value, throw an Error.

Parameters:
s - A string that may be printed along with any other error text.
expected - the expected value.
was - the actual value.
Throws:
Error - if 'flag' is false.