Bug 775102 - Update FennecTalosAssert so that assertion failures make the tests orange. r=gbrown

This commit is contained in:
Kartikaya Gupta 2012-07-19 14:18:36 -04:00
parent f9c1f519c6
commit 95515b9033

View File

@ -33,19 +33,39 @@ public class FennecTalosAssert implements Assert {
public void finalize() { }
public void ok(boolean condition, String name, String diag) { }
public void ok(boolean condition, String name, String diag) {
if (!condition) {
dumpLog("__FAIL" + name + ": " + diag + "__FAIL");
}
}
public void is(Object a, Object b, String name) { }
public void is(Object a, Object b, String name) {
boolean pass = (a == null ? b == null : a.equals(b));
ok(pass, name, "got " + a + ", expected " + b);
}
public void isnot(Object a, Object b, String name) { }
public void isnot(Object a, Object b, String name) {
boolean fail = (a == null ? b == null : a.equals(b));
ok(!fail, name, "got " + a + ", expected not " + b);
}
public void ispixel(int actual, int r, int g, int b, String name) { }
public void ispixel(int actual, int r, int g, int b, String name) {
throw new UnsupportedOperationException();
}
public void todo(boolean condition, String name, String diag) { }
public void todo(boolean condition, String name, String diag) {
throw new UnsupportedOperationException();
}
public void todo_is(Object a, Object b, String name) { }
public void todo_is(Object a, Object b, String name) {
throw new UnsupportedOperationException();
}
public void todo_isnot(Object a, Object b, String name) { }
public void todo_isnot(Object a, Object b, String name) {
throw new UnsupportedOperationException();
}
public void info(String name, String message) { }
public void info(String name, String message) {
dumpLog(name + ": " + message);
}
}