ICU-4530 Make HandlerTarget respect the filter.

X-SVN-Rev: 18744
This commit is contained in:
Eric Mader 2005-11-02 00:19:22 +00:00
parent 298377ea5b
commit ca1d882dc1
3 changed files with 37 additions and 29 deletions

View file

@ -982,7 +982,7 @@ public class TestFmwk extends AbstractTestLog {
public long seed;
public String tfilter; // for transliterator tests
private State stack;
public State stack;
private StringBuffer errorSummary;
@ -1015,11 +1015,13 @@ public class TestFmwk extends AbstractTestLog {
*/
public static TestParams create(String[] args, PrintWriter log) {
TestParams params = new TestParams();
if(log == null){
params.log = new NullWriter();
}else{
params.log = new ASCIIWriter(log, true);
}
boolean usageError = false;
String filter = null;
int wx = 0; // write argets.
@ -1161,7 +1163,7 @@ public class TestFmwk extends AbstractTestLog {
random = seed == 0 ? null : new Random(seed);
}
private class State {
public class State {
State link;
String name;
StringBuffer buffer;
@ -1171,7 +1173,7 @@ public class TestFmwk extends AbstractTestLog {
int ic;
int tc;
boolean flushed;
boolean included;
public boolean included;
long mem;
long millis;

View file

@ -88,34 +88,40 @@ public class CompatibilityTest extends TestFmwk
protected void execute() throws Exception
{
params.testCount += 1;
try {
ObjectInputStream in = new ObjectInputStream(inputStream);
Object inputObjects[] = (Object[]) in.readObject();
Object testObjects[] = handler.getTestObjects();
boolean passed = true;
in.close();
inputStream.close();
// TODO: add equality test...
// The commented out code below does that,
// but some test objects don't define an equals() method,
// and the default method is the same as the "==" operator...
for (int i = 0; i < testObjects.length; i += 1) {
// if (! inputObjects[i].equals(testObjects[i])) {
// errln("Input object " + i + " failed equality test.");
// }
if (params.inDocMode()) {
// nothing to execute
} else if (!params.stack.included) {
++params.invalidCount;
} else {
params.testCount += 1;
try {
ObjectInputStream in = new ObjectInputStream(inputStream);
Object inputObjects[] = (Object[]) in.readObject();
Object testObjects[] = handler.getTestObjects();
boolean passed = true;
if (! handler.hasSameBehavior(inputObjects[i], testObjects[i])) {
warnln("Input object " + i + " failed behavior test.");
in.close();
inputStream.close();
// TODO: add equality test...
// The commented out code below does that,
// but some test objects don't define an equals() method,
// and the default method is the same as the "==" operator...
for (int i = 0; i < testObjects.length; i += 1) {
// if (! inputObjects[i].equals(testObjects[i])) {
// errln("Input object " + i + " failed equality test.");
// }
if (! handler.hasSameBehavior(inputObjects[i], testObjects[i])) {
warnln("Input object " + i + " failed behavior test.");
}
}
}catch (MissingResourceException e){
warnln("Could not load the data. "+e.getMessage());
} catch (Exception e) {
errln("Exception: " + e.toString());
}
}catch (MissingResourceException e){
warnln("Could not load the data. "+e.getMessage());
} catch (Exception e) {
errln("Exception: " + e.toString());
}
}
}

View file

@ -1021,7 +1021,7 @@ public final class ICUResourceBundleTest extends TestFmwk {
i++;
}
if(i!=4){
errln("Did not get the expected number of keys");
errln("Did not get the expected number of keys: got " + i + ", expected 4");
}
UResourceBundle bundle4 = UResourceBundle.getBundleInstance(baseName,"fr_Latn_FR");
if(bundle==null){