OSDN Git Service

Remove as sg.exe is not a open source product.
[nxt-jsp/etrobo-atk.git] / nxtOSEK / lejos_nxj / src / java / classes / lejos / util / Assertion.java
1 package lejos.util;
2
3 /**
4  * Class used in debugging to test assertions. Implementation
5  * is platform dependent. For example the unix_impl version
6  * will print the string and throw an error if an assertion fails.
7  * The rcx_impl version will only throw an error.
8  *
9  * @author Paul Andrews
10  */
11 public class Assertion {
12         /**
13          * @param s A string that may be printed along with any other
14          *          error text.
15          * @param flag if true then an Error will be thrown, otherwise
16          *             nothing will happend.
17          * @throws Error if 'flag' is false.
18          */
19         public static native void test(String s, boolean flag);
20         
21         /**
22          * If the actual value is not equal to the expected value, throw an Error.
23          * @param s A string that may be printed along with any other
24          *          error text.
25          * @param expected the expected value.
26          * @param was the actual value.
27          * @throws Error if 'flag' is false.
28          */
29         public static native void testEQ(String s, int expected, int was);
30 }