From 7de3ef0517e72a584e76803696eb94051a6d2dc4 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 24 Sep 2005 21:17:19 +0000 Subject: [PATCH] dont read every record unless verbose --- .../src/net/hyperic/sigar/win32/test/TestEventLog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/win32/test/TestEventLog.java b/bindings/java/src/net/hyperic/sigar/win32/test/TestEventLog.java index 0a7fa824..193ea04d 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/test/TestEventLog.java +++ b/bindings/java/src/net/hyperic/sigar/win32/test/TestEventLog.java @@ -82,11 +82,15 @@ public class TestEventLog extends SigarTestCase { log.open(logname); int oldestRecord = log.getOldestRecord(); int numRecords = log.getNumberOfRecords(); + traceln("oldest=" + oldestRecord + ", total=" + numRecords); for (int i = oldestRecord; i < oldestRecord + numRecords; i++) { try { record = log.read(i); success++; + if (!getVerbose() && (success > 500)) { + break; //read plenty + } } catch (Win32Exception e) { fail++; traceln("Error reading record " + i + ": " + @@ -95,7 +99,8 @@ public class TestEventLog extends SigarTestCase { } log.close(); - + + traceln("success=" + success + ", fail=" + fail); return success > fail; }