Tcp fields can be == FIELD_NOTIMPL

This commit is contained in:
Doug MacEachern 2008-07-13 04:12:05 +00:00
parent c1d79d091c
commit 61f443ba07
2 changed files with 15 additions and 9 deletions

View File

@ -152,6 +152,12 @@ public abstract class SigarTestCase extends TestCase {
assertTrue(msg, value >= 0);
}
public void assertValidFieldTrace(String msg, long value) {
if (value != Sigar.FIELD_NOTIMPL) {
assertGtEqZeroTrace(msg, value);
}
}
public void assertEqualsTrace(String msg, long expected, long actual) {
traceln(msg + "=" + actual + "/" + expected);
assertEquals(msg, expected, actual);

View File

@ -39,14 +39,14 @@ public class TestTcpStat extends SigarTestCase {
}
traceln("");
assertGtEqZeroTrace("ActiveOpens", tcp.getActiveOpens());
assertGtEqZeroTrace("PassiveOpens", tcp.getPassiveOpens());
assertGtEqZeroTrace("AttemptFails", tcp.getAttemptFails());
assertGtEqZeroTrace("EstabResets", tcp.getEstabResets());
assertGtEqZeroTrace("CurrEstab", tcp.getCurrEstab());
assertGtEqZeroTrace("InSegs", tcp.getInSegs());
assertGtEqZeroTrace("OutSegs", tcp.getOutSegs());
assertGtEqZeroTrace("RetransSegs", tcp.getRetransSegs());
assertGtEqZeroTrace("OutRsts", tcp.getOutRsts());
assertValidFieldTrace("ActiveOpens", tcp.getActiveOpens());
assertValidFieldTrace("PassiveOpens", tcp.getPassiveOpens());
assertValidFieldTrace("AttemptFails", tcp.getAttemptFails());
assertValidFieldTrace("EstabResets", tcp.getEstabResets());
assertValidFieldTrace("CurrEstab", tcp.getCurrEstab());
assertValidFieldTrace("InSegs", tcp.getInSegs());
assertValidFieldTrace("OutSegs", tcp.getOutSegs());
assertValidFieldTrace("RetransSegs", tcp.getRetransSegs());
assertValidFieldTrace("OutRsts", tcp.getOutRsts());
}
}