Track expected pass/fail per class file.

This commit is contained in:
Brendan Dahl 2015-02-04 16:14:14 -08:00
Родитель 022bb19df9
Коммит ed79925e66
161 изменённых файлов: 527 добавлений и 20 удалений

Просмотреть файл

@ -77,7 +77,7 @@ public class RunTests extends MIDlet {
}
};
int pass = 0, fail = 0, knownFail = 0, unknownPass = 0;
int classPass = 0, classFail = 0, pass = 0, fail = 0, knownFail = 0, unknownPass = 0;
void runTest(String name) {
name = name.replace('/', '.');
@ -109,6 +109,24 @@ public class RunTests extends MIDlet {
harness.fail("Test threw an unexpected exception");
}
harness.report();
boolean classPassed = true;
if (harness.passed() != t.getExpectedPass()) {
classPassed = false;
System.err.println(name + ": test expected " + t.getExpectedPass() + " passes, got " + harness.passed());
}
if (harness.failed() != t.getExpectedFail()) {
classPassed = false;
System.err.println(name + ": test expected " + t.getExpectedFail() + " failures, got " + harness.failed());
}
if (harness.knownFailed() != t.getExpectedKnownFail()) {
classPassed = false;
System.err.println(name + ": test expected " + t.getExpectedKnownFail() + " known failures, got " + harness.knownFailed());
}
if (classPassed) {
classPass++;
} else {
classFail++;
}
pass += harness.passed();
fail += harness.failed();
knownFail += harness.knownFailed();
@ -144,8 +162,9 @@ public class RunTests extends MIDlet {
runTest(name);
}
}
System.out.println("DONE: " + pass + " pass, " + fail + " fail, " + knownFail + " known fail, " +
unknownPass + " unknown pass, " + (JVM.monotonicTimeMillis() - then) + "ms");
System.out.println("TOTALS: " + pass + " pass, " + fail + " fail, " + knownFail + " known fail, " +
unknownPass + " unknown pass");
System.out.println("DONE: " + classPass + " class pass, " + classFail + " class fail, " + (JVM.monotonicTimeMillis() - then) + "ms");
}
public void pauseApp() {

Просмотреть файл

@ -69,13 +69,6 @@ var gfxTests = [
{ name: "gfx/DrawStringWithCopyrightAndRegisteredSymbols", maxDifferent: 244 },
];
var expectedUnitTestResults = [
{ name: "pass", number: 71565 },
{ name: "fail", number: 0 },
{ name: "known fail", number: 215 },
{ name: "unknown pass", number: 0 }
];
/**
* Add a step that syncs the virtual filesystem to the persistent datastore,
* to ensure all changes are synced before we move to the next step.
@ -123,23 +116,18 @@ casper.test.begin("unit tests", 16 + gfxTests.length, function(test) {
function basicUnitTests() {
casper.waitForText("DONE", function() {
var content = this.getPageContent();
var regex = /DONE: (\d+) pass, (\d+) fail, (\d+) known fail, (\d+) unknown pass/;
var regex = /DONE: (\d+) class pass, (\d+) class fail/;
var match = content.match(regex);
if (!match || !match.length || match.length < 5) {
if (!match || !match.length || match.length < 3) {
this.echo("data:image/png;base64," + this.captureBase64('png'));
test.fail('failed to parse status line of main unit tests');
} else {
var msg = "";
for (var i = 0; i < expectedUnitTestResults.length; i++) {
if (match[i+1] != expectedUnitTestResults[i].number) {
msg += "\n\tExpected " + expectedUnitTestResults[i].number + " " + expectedUnitTestResults[i].name + ". Got " + match[i+1];
}
}
if (!msg) {
var failed = match[2];
if (failed === "0") {
test.pass('main unit tests');
} else {
this.echo("data:image/png;base64," + this.captureBase64('png'));
test.fail(msg);
test.fail(failed + " unit test(s) failed");
}
}
syncFS();

Просмотреть файл

@ -11,6 +11,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestFileConnection implements Testlet {
public int getExpectedPass() { return 160; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
String dirPath;
FileConnection dir;

Просмотреть файл

@ -8,6 +8,9 @@ import javax.microedition.io.file.*;
import javax.microedition.io.*;
public class TestLauncher implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
native boolean checkImageModalDialog();
public void test(TestHarness th) {

Просмотреть файл

@ -6,6 +6,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestDataEncodeDecode implements Testlet {
public int getExpectedPass() { return 92; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
void testString(TestHarness th) throws IOException {
DataEncoder encoder = new DataEncoder("whatever");
encoder.putStart(DataType.STRUCT, "event");

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestDeviceControl implements Testlet {
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
try {
DeviceControl.stopVibra();

Просмотреть файл

@ -5,6 +5,9 @@ import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
public class TestDirectGraphics implements Testlet {
public int getExpectedPass() { return 6; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 1; }
public void test(TestHarness th) {
int[] pixels = new int[1];
Image image = DirectUtils.createImage(1, 1, 0x0000FF00);

Просмотреть файл

@ -11,6 +11,9 @@ import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.TextField;
public class TestTextEditor extends Canvas implements Testlet {
public int getExpectedPass() { return 146; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void testConstraints(TestHarness th, int constraints, int tolerance) {
String text = "</div>Hello, world!";
TextEditor textEditor = new TextEditor(text, 20, 0, 100, 24);

Просмотреть файл

@ -46,6 +46,9 @@ class TestKeyboardVisibilityListener implements com.nokia.mid.ui.KeyboardVisibil
}
public class TestVirtualKeyboard extends Canvas implements Testlet {
public int getExpectedPass() { return 9; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public native static void hideKeyboard();
public native static void showKeyboard();

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestFrameAnimator implements Testlet, FrameAnimatorListener {
public int getExpectedPass() { return 13; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
FrameAnimator animator = new FrameAnimator();
th.check(animator.isRegistered(), false);

Просмотреть файл

@ -32,6 +32,9 @@ import gnu.testlet.Testlet;
import java.io.*;
public class TestUtfReaders implements Testlet {
public int getExpectedPass() { return 63; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 3; }
TestHarness th;
public String teststr1 = "你好世界";

Просмотреть файл

@ -6,6 +6,9 @@ import gnu.testlet.Testlet;
import java.io.*;
public class TestResourceInputStream implements Testlet {
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness th;
private String readLine(InputStreamReader reader) throws IOException {

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestAES implements Testlet {
public int getExpectedPass() { return 20; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestARC4 implements Testlet {
public int getExpectedPass() { return 31; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestDES implements Testlet {
public int getExpectedPass() { return 20; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestMD5 implements Testlet {
public int getExpectedPass() { return 13; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestRSA implements Testlet {
public int getExpectedPass() { return 16; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestSHA implements Testlet {
public int getExpectedPass() { return 13; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -33,6 +33,9 @@ import gnu.testlet.Testlet;
* Unit tests for the EventQueue class.
*/
public class TestEventQueue implements Testlet {
public int getExpectedPass() { return 47; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness th;
/**

Просмотреть файл

@ -33,6 +33,9 @@ import gnu.testlet.Testlet;
* Unit tests for the NativeEventPool class.
*/
public class TestNativeEventPool implements Testlet {
public int getExpectedPass() { return 25; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness th;
/**

Просмотреть файл

@ -27,6 +27,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestHttpUrl implements Testlet {
public int getExpectedPass() { return 110; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 5; }
/**
* Runs all the tests.
*/

Просмотреть файл

@ -30,6 +30,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestUrl implements Testlet {
public int getExpectedPass() { return 28; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness th;
private void testUrl(String url, boolean isCorrect) {

Просмотреть файл

@ -6,6 +6,9 @@ import java.io.*;
import javax.microedition.io.*;
public class TestHttpConnection implements Testlet {
public int getExpectedPass() { return 0; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 2; }
public void test(TestHarness th) {
try {
HttpConnection hc = (HttpConnection)Connector.open("http://localhost:8000/tests/test.html");

Просмотреть файл

@ -40,6 +40,9 @@ import javax.microedition.io.StreamConnection;
import javax.microedition.io.Connector;
public class TestHttpHeaders implements Testlet {
public int getExpectedPass() { return 12; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
final String URL = "//nonexistent.example.com:8080/foo/bar?bazz#mumble";
StubHttpProtocol conn;

Просмотреть файл

@ -6,6 +6,9 @@ import java.io.*;
import javax.microedition.io.*;
public class StressTestSocket implements Testlet {
public int getExpectedPass() { return 0; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 1; }
TestHarness th;
static final String URL = "socket://localhost:50003";

Просмотреть файл

@ -6,6 +6,9 @@ import java.io.*;
import javax.microedition.io.*;
public class TestSocket implements Testlet {
public int getExpectedPass() { return 0; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 2; }
public void test(TestHarness th) {
try {
testBasicSocketConnection(th);

Просмотреть файл

@ -8,6 +8,9 @@ import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;
public class TestRandomAccessStream implements Testlet {
public int getExpectedPass() { return 108; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
RandomAccessStream ras = new RandomAccessStream();

Просмотреть файл

@ -10,6 +10,9 @@ import java.io.*;
import com.sun.midp.io.j2me.storage.RandomAccessStream;
public class TestInputOutputStorage implements Testlet {
public int getExpectedPass() { return 13; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
void testWrite(TestHarness th, OutputStream out) throws IOException {
OutputStorage outStorage = new OutputStorage(out);
outStorage.writeValue((byte)1, "Marco");

Просмотреть файл

@ -11,6 +11,9 @@ import com.sun.midp.security.*;
import com.sun.midp.main.Configuration;
public class TestWebPublicKeyStore implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
static final byte[] GoDaddySecureCertificationAuthorityDER = hexToBytes("308204de308203c6a00302010202020301300d06092a864886f70d01010505003063310b30090603550406130255533121301f060355040a131854686520476f2044616464792047726f75702c20496e632e3131302f060355040b1328476f20446164647920436c61737320322043657274696669636174696f6e20417574686f72697479301e170d3036313131363031353433375a170d3236313131363031353433375a3081ca310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c65311a3018060355040a1311476f44616464792e636f6d2c20496e632e31333031060355040b132a687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72793130302e06035504031327476f204461646479205365637572652043657274696669636174696f6e20417574686f726974793111300f06035504051308303739363932383730820122300d06092a864886f70d01010105000382010f003082010a0282010100c42dd5158c9c264cec3235eb5fb859015aa66181593b7063abe3dc3dc72ab8c933d379e43aed3c3023848eb33014b6b287c33d9554049edf99dd0b251e21de65297e35a8a954ebf6f73239d4265595adeffbfe5886d79ef4008d8c2a0cbd4204cea73f04f6ee80f2aaef52a16966dabe1aad5dda2c66ea1a6bbbe51a514a002f48c79875d8b929c8eef8666d0a9cb3f3fc787ca2f8a3f2b5c3f3b97a91c1a7e6252e9ca8ed12656e6af6124453703095c39c2b582b3d08744af2be51b0bf87d04c27586bb535c59daf1731f80b8feead813605890898cf3aaf2587c049eaa7fd67f7458e97cc1439e23685b57e1a37fd16f671119a743016fe1394a33f840d4f0203010001a38201323082012e301d0603551d0e04160414fdac6132936c45d6e2ee855f9abae7769968cce7301f0603551d23041830168014d2c4b0d291d44c1171b361cb3da1fedda86ad4e330120603551d130101ff040830060101ff020100303306082b0601050507010104273025302306082b060105050730018617687474703a2f2f6f6373702e676f64616464792e636f6d30460603551d1f043f303d303ba039a0378635687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72792f6764726f6f742e63726c304b0603551d200444304230400604551d20003038303606082b06010505070201162a687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f7279300e0603551d0f0101ff040403020106300d06092a864886f70d01010505000382010100d286c0ecbdf9a1b667ee660ba2063a04508e1572ac4a749553cb37cb4449ef07906b33d996f09456a51330053c8532217bc9c70aa824a490de46d32523140367c210d66f0f5d7b7acc9fc5582ac1c49e21a85af3aca446f39ee463cb2f90a4292901d9722c29df370127bc4fee68d3218fc0b3e4f509edd210aa53b4bef0cc590bd63b961c952449dfceecfda7489114450e3a366fda45b345a241c9d4d7444e3eb97476d5a213552cc687a3b599ac0684877f7506fcbf144c0ecc6ec4df3db71271f4e8f15140222849e01d4b87a834cc06a2dd125ad186366403356f6f776eebf28550985eab0353ad9123631f169ccdb9b205633ae1f4681b1705359553ee");
static final byte[] GoDaddyDotComDER = hexToBytes("308205d6308204bea00302010202074afcc0e2e233aa300d06092a864886f70d01010505003081ca310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c65311a3018060355040a1311476f44616464792e636f6d2c20496e632e31333031060355040b132a687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72793130302e06035504031327476f204461646479205365637572652043657274696669636174696f6e20417574686f726974793111300f060355040513083037393639323837301e170d3134303432383134343633345a170d3135313230363137333732345a3081cd31133011060b2b0601040182373c0201031302555331183016060b2b0601040182373c02010213074172697a6f6e61311d301b060355040f131450726976617465204f7267616e697a6174696f6e311430120603550405130b522d313732343733332d36310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c6531193017060355040a1310476f44616464792e636f6d2c204c4c43311830160603550403130f7777772e676f64616464792e636f6d30820122300d06092a864886f70d01010105000382010f003082010a0282010100c5b14c056beb6b77ab00ff5e9352ef6c7c4564e5cf0a14ac038ab4635dcf4fa9b0cbb62a3222722759af530e17b4a0e8aa9f28cf2d828f12f020fb6c7fc8d945943fbaba873f9892e02510f71312775cf26ccc0696d272d3d774e7e4a580d399f13a22b34ec12fe14ad74e220b3f155b360b59a61f380046bcaa65ca6426c2e8a5f50f5f8f50fce0a1cee4b9cedecc8742d7e107bb57388485d9bfc08a87bd4ab815ce753be4618c86e20cc01c53ba36e02a093c0ddd958c4abda53468320b12fb41437dc3fbf3aa1737d56b7eb9012611cdcf51ad788ffda2198ffac5722ba15b2994d533ff51daa757784bd5853f94a0f185da5e9e49cf6b13d0cf801fd9df0203010001a38201ba308201b6300f0603551d130101ff04053003010100301d0603551d250416301406082b0601050507030106082b06010505070302300e0603551d0f0101ff0404030205a030330603551d1f042c302a3028a026a0248622687474703a2f2f63726c2e676f64616464792e636f6d2f676473332d39322e63726c30530603551d20044c304a3048060b6086480186fd6d010717033039303706082b06010505070201162b687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72792f30818006082b0601050507010104743072302406082b060105050730018618687474703a2f2f6f6373702e676f64616464792e636f6d2f304a06082b06010505073002863e687474703a2f2f6365727469666963617465732e676f64616464792e636f6d2f7265706f7369746f72792f67645f696e7465726d6564696174652e637274301f0603551d23041830168014fdac6132936c45d6e2ee855f9abae7769968cce730270603551d110420301e820f7777772e676f64616464792e636f6d820b676f64616464792e636f6d301d0603551d0e0416041447b5046b1a8403da6902bb833995879edeb63779300d06092a864886f70d01010505000382010100bb60237e7a48f6d1c86011b1cea9f2fd3eec7215e1c105e4f261ebe11cdbdb8a82d5faa3f1a622931ef1ee81fa8101e096b2f6582ef84b534fc3d00790eefc955d3f53e4122c8c22b212f8512c51a41a6bfe0a54f9feddab539764f359f3eae21640b72166038705cb7d26864763f036699a36fcca5d1c4fdcf5b370561d469c792fc38ae383efbb3fb0382a390defe1d248dc1c9d82e4feb7413852e899d3582f0a343ff0bf83025a5510d352914d5f43caf7e05b5e93640ec2d71f912c74fdbed6584e175257c0ff27f22f89a17760766dcb76e9a553601a7b7653a5810e7fe0fff429d9df54c4dc11e72a55e79914dd0421dcb303e03e908f94093bde49bb");

Просмотреть файл

@ -7,6 +7,9 @@ import javax.microedition.io.file.FileConnection;
import javax.microedition.rms.RecordStoreException;
public class TestRecordStoreFileNatives implements Testlet, SuiteContainer {
public int getExpectedPass() { return 14; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
// SuiteContainer stubs
public int getCallersSuiteId() { return 0; }
public int getSuiteId(String vendorName, String suiteName) { return 0; }

Просмотреть файл

@ -13,6 +13,9 @@ import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
public class TestSSLStreamConnection implements Testlet {
public int getExpectedPass() { return 0; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 1; }
static final String SOCKET_URL = "socket://localhost:54443";
static final String HOST = "localhost";
static final int PORT = 54443;

Просмотреть файл

@ -64,6 +64,9 @@ class LockerThread extends Thread {
}
public class TestInterIsolateMutex implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
SecurityToken t = SecurityTokenProvider.getToken();
InterIsolateMutex m = InterIsolateMutex.getInstance(t, "mutex");

Просмотреть файл

@ -21,5 +21,8 @@
package gnu.testlet;
public interface Testlet {
public abstract int getExpectedPass();
public abstract int getExpectedFail();
public abstract int getExpectedKnownFail();
public abstract void test (TestHarness harness);
}

Просмотреть файл

@ -4,6 +4,9 @@ import java.io.*;
import gnu.testlet.*;
public class ByteArrayInputStreamTest implements Testlet {
public int getExpectedPass() { return 46; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
byte[] a = new byte[11];
for (int i = 0; i < a.length; i++) {

Просмотреть файл

@ -4,6 +4,9 @@ import java.io.*;
import gnu.testlet.*;
public class ByteArrayOutputStreamTest implements Testlet {
public int getExpectedPass() { return 30; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
ByteArrayOutputStream s = new ByteArrayOutputStream();
th.check(s.size() == 0);

Просмотреть файл

@ -4,6 +4,9 @@ import java.io.*;
import gnu.testlet.*;
public class DataInputStreamTest implements Testlet {
public int getExpectedPass() { return 44; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
try {
byte[] input = {-2, 54, -2, 0, 1, 0, -128, 1, 91, -64, 0x0C, 0x7A, -31, 0x47, -82, 0x14, 0x7B, 0x41, 0x09,

Просмотреть файл

@ -4,6 +4,9 @@ import java.io.*;
import gnu.testlet.*;
public class DataOutputStreamTest implements Testlet {
public int getExpectedPass() { return 52; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
try {

Просмотреть файл

@ -4,6 +4,9 @@ import java.io.*;
import gnu.testlet.*;
public class PrintStreamTest implements Testlet {
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream s = new PrintStream(out);

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class BooleanTest implements Testlet
{
public int getExpectedPass() { return 8; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test_Basics(TestHarness harness)
{
harness.checkPoint ("Basics");

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.java.lang.Boolean;
import gnu.testlet.*;
public class BooleanTest2 implements Testlet {
public int getExpectedPass() { return 11; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
th.check(Boolean.TRUE.booleanValue());
th.check(!Boolean.FALSE.booleanValue());

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class equals_Boolean implements Testlet
{
public int getExpectedPass() { return 6; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Boolean a = new Boolean(true);

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class hashcode_Boolean implements Testlet
{
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Boolean a = new Boolean(true);

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class ByteTest implements Testlet
{
public int getExpectedPass() { return 8; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
protected static TestHarness harness;
public void test_Basics()
{

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
*/
public class byteDivide implements Testlet
{
public int getExpectedPass() { return 21; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* Entry pobyte to this test.

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class new_Byte implements Testlet
{
public int getExpectedPass() { return 5; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Byte a = new Byte((byte) 0);

Просмотреть файл

@ -29,6 +29,9 @@ import gnu.testlet.TestHarness;
*/
public class parseByte implements Testlet
{
public int getExpectedPass() { return 16; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
byte b;

Просмотреть файл

@ -29,6 +29,9 @@ import gnu.testlet.TestHarness;
*/
public class parseByteRadix implements Testlet
{
public int getExpectedPass() { return 20; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
byte b;

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class CharacterTest implements Testlet
{
public int getExpectedPass() { return 10; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
protected static TestHarness harness;
public void test_Basics()
{

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class hash implements Testlet
{
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Character a = new Character ('\uffda');

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class to implements Testlet
{
public int getExpectedPass() { return 12; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
harness.check (Character.toUpperCase ('a'), 'A');

Просмотреть файл

@ -4,6 +4,9 @@ import java.util.Date;
import gnu.testlet.*;
public class DateTest implements Testlet {
public int getExpectedPass() { return 5; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
Date d = new Date();
// This test is not reliable:

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class DoubleTest implements Testlet
{
public int getExpectedPass() { return 106; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
protected static TestHarness harness;
public void test_Basics()

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.java.lang.Integer;
import gnu.testlet.*;
public class IntegerTest implements Testlet {
public int getExpectedPass() { return 38; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
th.check(Integer.toString(543), ("543"));
th.check(Integer.toString(-543), ("-543"));

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class LongTest implements Testlet
{
public int getExpectedPass() { return 39; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
protected static TestHarness harness;
public void test_Basics()

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
*/
public class longDivide implements Testlet
{
public int getExpectedPass() { return 21; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* Entry point to this test.

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
*/
public class longModulo implements Testlet
{
public int getExpectedPass() { return 21; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* Entry point to this test.

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class new_Long implements Testlet
{
public int getExpectedPass() { return 60; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Long a = new Long(0L);

Просмотреть файл

@ -29,6 +29,9 @@ import gnu.testlet.TestHarness;
*/
public class parseLongRadix implements Testlet
{
public int getExpectedPass() { return 20; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
long l;

Просмотреть файл

@ -29,6 +29,9 @@ import gnu.testlet.TestHarness;
*/
public class toString implements Testlet
{
public int getExpectedPass() { return 18; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
// test of method Long.toString()

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class max implements Testlet
{
public int getExpectedPass() { return 32; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
harness.check (Double.toString (Math.max (0.0, -0.0)), "0.0");

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class min implements Testlet
{
public int getExpectedPass() { return 41; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
harness.checkPoint("Small doubles");

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class ObjectTest implements Testlet
{
public int getExpectedPass() { return 0; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
boolean finFlag = false;
protected static TestHarness harness;

Просмотреть файл

@ -37,6 +37,9 @@ import java.lang.Object;
*/
public class constructor implements Testlet
{
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* Runs the test using the specified harness.

Просмотреть файл

@ -30,6 +30,9 @@ import gnu.testlet.TestHarness;
* with threaded programming.
*/
public final class wait implements Testlet {
public int getExpectedPass() { return 8; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
// wait must have reasonable args

Просмотреть файл

@ -26,6 +26,9 @@ import gnu.testlet.TestHarness;
public class arraycopy implements Testlet
{
public int getExpectedPass() { return 30; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void fill (int[] a)
{
for (int i = 0; i < a.length; ++i)

Просмотреть файл

@ -25,6 +25,9 @@ import gnu.testlet.TestHarness;
public class getProperty implements Testlet
{
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness harness;

Просмотреть файл

@ -27,6 +27,9 @@ import gnu.testlet.TestHarness;
public class isAlive extends Thread implements Testlet
{
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
boolean started = false;
boolean please_stop = false;

Просмотреть файл

@ -27,6 +27,9 @@ import gnu.testlet.TestHarness;
public class name implements Testlet
{
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{

Просмотреть файл

@ -5,6 +5,9 @@ import gnu.testlet.TestHarness;
public class wait implements Testlet
{
public int getExpectedPass() { return 1; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
TestHarness th;
Object o;
Object done;

Просмотреть файл

@ -31,6 +31,9 @@ import java.util.Hashtable;
*/
public class ContainsHash extends Hashtable implements Testlet
{
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
private static Object a = new Object();
private static Object b = new Object();

Просмотреть файл

@ -37,6 +37,9 @@ import java.util.Enumeration;
*/
public class EnumerateAndModify implements Testlet
{
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* test is the main test routine testing enumaration of keys and

Просмотреть файл

@ -31,6 +31,9 @@ import java.util.Hashtable;
*/
public class HashContains extends Hashtable implements Testlet
{
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
Object a = new Object();

Просмотреть файл

@ -26,6 +26,9 @@ import java.util.Hashtable;
public class basic implements Testlet
{
public int getExpectedPass() { return 11; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test (TestHarness harness)
{
// The toString tests have been commented out as they currently

Просмотреть файл

@ -31,6 +31,9 @@ import java.util.Vector;
*/
public class copyInto implements Testlet
{
public int getExpectedPass() { return 11; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
/**
* Runs the test using the specified harness.

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class ArrayTest implements Testlet {
public int getExpectedPass() { return 11; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
byte b1[][] = new byte[3][4];
b1[1][2] = 5;

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class BytecodesTest implements Testlet {
public int getExpectedPass() { return 49; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
String s = null;
th.check(s == null);

Просмотреть файл

@ -35,6 +35,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class ClassTest implements Testlet {
public int getExpectedPass() { return 17; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
protected TestHarness th;
public void test(TestHarness harness) {

Просмотреть файл

@ -5,6 +5,9 @@ import java.util.Date;
import gnu.testlet.*;
public class ClassTest2 implements Testlet {
public int getExpectedPass() { return 11; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
try {
Class c = Class.forName("java.util.Date");

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class ConditionsTest implements Testlet {
public int getExpectedPass() { return 19; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
String a, b, c;
a = "smt";

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class DupTest implements Testlet {
public int getExpectedPass() { return 8; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
// do it twice so we know the adding was done correctly in the first call
th.check(dup2(), 5);

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class ExceptionTest implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
void throw1(TestHarness th) {
boolean caught = false;
try {

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class FieldNotFoundException implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
void throw1(TestHarness th) {
boolean caught = false;
try {

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class GetBytesTest implements Testlet {
public int getExpectedPass() { return 897; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
private static byte[] hexToBytes(String s) {
int len = s.length();
byte[] data = new byte[len / 2];

Просмотреть файл

@ -4,6 +4,9 @@ import java.util.Vector;
import gnu.testlet.*;
public class InterfaceTest implements Testlet {
public int getExpectedPass() { return 6; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
private interface A {
public void x();

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class LongTest implements Testlet {
public int getExpectedPass() { return 9; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
static long h = 0x0123456789abcdefL;
static long a = 5;
static long b = 7;

Просмотреть файл

@ -36,6 +36,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class MathTest implements Testlet {
public int getExpectedPass() { return 1; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
static boolean near(double a, double b) {

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class MethodNotFoundException implements Testlet {
public int getExpectedPass() { return 3; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
void throw1(TestHarness th) {
boolean caught = false;
try {

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class NativeTest implements Testlet {
public int getExpectedPass() { return 17; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
native static int getInt();
native static int fromJavaString(String string);
native static int decodeUtf8(byte[] string);

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class NestedExceptionTest implements Testlet {
public int getExpectedPass() { return 14; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
private static boolean firstFinallyCalled = false;
private static boolean finallyReturnCalled = false;
private static boolean finallyReturnReturned = false;

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class ObjectsTest implements Testlet {
public int getExpectedPass() { return 5; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
class A {
private int a;

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class OpsTest implements Testlet {
public int getExpectedPass() { return 15; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
int iadd(int a, int b) {
return a + b;
}

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class OverrideTest implements Testlet {
public int getExpectedPass() { return 2; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
static int overridden() {
return 1;
}

Просмотреть файл

@ -3,6 +3,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class RuntimeTest implements Testlet {
public int getExpectedPass() { return 1; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
Runtime r = Runtime.getRuntime();
th.check(r.freeMemory() < r.totalMemory());

Просмотреть файл

@ -36,6 +36,9 @@ import gnu.testlet.*;
import java.io.UnsupportedEncodingException;
class StringBufferTest implements Testlet {
public int getExpectedPass() { return 25; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
private TestHarness th;
public void test(TestHarness th) {

Просмотреть файл

@ -6,6 +6,9 @@ import java.io.*;
import java.util.Date;
public class StringTest implements Testlet {
public int getExpectedPass() { return 99; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
try {
String s = new String();

Просмотреть файл

@ -36,6 +36,9 @@ package gnu.testlet.vm;
import gnu.testlet.*;
public class SystemTest implements Testlet {
public int getExpectedPass() { return 1; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
final static int ASX = 10;
final static int NPX = 20;
final static int ISX = 30;

Просмотреть файл

@ -16,6 +16,9 @@ import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
class TestArithmetic implements Testlet {
public int getExpectedPass() { return 276; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 2; }
TestHarness th;
private static int int_3 = -3;

Просмотреть файл

@ -5,6 +5,9 @@ import com.sun.cldc.isolate.*;
import gnu.testlet.vm.IsolatedClass;
public class TestIsolate implements Testlet {
public int getExpectedPass() { return 4; }
public int getExpectedFail() { return 0; }
public int getExpectedKnownFail() { return 0; }
public void test(TestHarness th) {
th.check(IsolatedClass.val, 1);

Просмотреть файл

@ -9,6 +9,20 @@
return
.end method
.method public getExpectedPass()I
iconst_1
ireturn
.end method
.method public getExpectedFail()I
iconst_0
ireturn
.end method
.method public getExpectedKnownFail()I
iconst_0
ireturn
.end method
.method public test(Lgnu/testlet/TestHarness;)V
.limit stack 2

Просмотреть файл

@ -12,6 +12,21 @@
return
.end method
.method public getExpectedPass()I
iconst_1
ireturn
.end method
.method public getExpectedFail()I
iconst_0
ireturn
.end method
.method public getExpectedKnownFail()I
iconst_0
ireturn
.end method
.method public test(Lgnu/testlet/TestHarness;)V
.limit stack 2
.limit locals 2

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше