assertion.java

来自「专业汽车级嵌入式操作系统OSEK的源代码」· Java 代码 · 共 31 行

JAVA
31
字号
package lejos.util;/** * 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 */public class Assertion {	/**	 * @param s A string that may be printed along with any other	 *          error text.	 * @param flag if true then an Error will be thrown, otherwise	 *             nothing will happend.	 * @throws Error if 'flag' is false.	 */	public static native void test(String s, boolean flag);		/**	 * If the actual value is not equal to the expected value, throw an Error.	 * @param s A string that may be printed along with any other	 *          error text.	 * @param expected the expected value.	 * @param was the actual value.	 * @throws Error if 'flag' is false.	 */	public static native void testEQ(String s, int expected, int was);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?