Use fail() instead of assertTrue(false).

This commit is contained in:
akwizgran
2011-08-03 21:19:04 +01:00
parent 93ee4d004e
commit 5be9d953ee
10 changed files with 26 additions and 26 deletions

View File

@@ -138,7 +138,7 @@ public class ReaderImplTest extends TestCase {
assertEquals("foo", r.readString(3));
try {
r.readString(2);
assertTrue(false);
fail();
} catch(FormatException expected) {}
}
@@ -158,7 +158,7 @@ public class ReaderImplTest extends TestCase {
assertTrue(Arrays.equals(new byte[] {1, 2, 3}, r.readBytes(3)));
try {
r.readBytes(2);
assertTrue(false);
fail();
} catch(FormatException expected) {}
}
@@ -205,7 +205,7 @@ public class ReaderImplTest extends TestCase {
// FormatException
try {
r.readList(Byte.class);
assertTrue(false);
fail();
} catch(FormatException expected) {}
}
@@ -423,7 +423,7 @@ public class ReaderImplTest extends TestCase {
// No object reader has been added for tag 0
try {
r.readUserDefined(0, Foo.class);
assertTrue(false);
fail();
} catch(FormatException expected) {}
}
@@ -441,7 +441,7 @@ public class ReaderImplTest extends TestCase {
// Trying to read the object as class Bar should throw a FormatException
try {
r.readUserDefined(0, Bar.class);
assertTrue(false);
fail();
} catch(FormatException expected) {}
}