Tcp fields can be == FIELD_NOTIMPL
This commit is contained in:
parent
c1d79d091c
commit
61f443ba07
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue