poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r675785 - /poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
Date Thu, 10 Jul 2008 22:22:25 GMT
Author: nick
Date: Thu Jul 10 15:22:24 2008
New Revision: 675785

URL: http://svn.apache.org/viewvc?rev=675785&view=rev
Log:
Tweak test to run forward and back

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java?rev=675785&r1=675784&r2=675785&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java Thu
Jul 10 15:22:24 2008
@@ -297,7 +297,8 @@
 	
 	/**
 	 * Apparently, each subsequent call takes longer, which is very
-	 *  odd
+	 *  odd.
+	 * We think it's because the formulas are recursive and crazy
 	 */
 	public void DISABLEDtestSlowEvaluate45376() throws Exception {
 		HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("45376.xls");
@@ -309,7 +310,7 @@
         int firstCol = 4;
         int lastCol = 14;
         long[] timings = new long[lastCol-firstCol+1];
-        long[] stimings = new long[lastCol-firstCol+1];
+        long[] rtimings = new long[lastCol-firstCol+1];
         
         long then, now;
 
@@ -327,6 +328,19 @@
              timings[i-firstCol] = (then-now);
              System.err.println("Col " + i + " took " + (then-now) + "ms");
         }
+        for(int i = lastCol; i >= firstCol; i--) {
+            final HSSFCell excelCell = excelRow.getCell(i);
+            final HSSFFormulaEvaluator evaluator = new
+                HSSFFormulaEvaluator(sheet, wb);
+
+            evaluator.setCurrentRow(excelRow);
+            
+            now = System.currentTimeMillis();
+            evaluator.evaluate(excelCell);
+            then = System.currentTimeMillis();
+            rtimings[i-firstCol] = (then-now);
+            System.err.println("Col " + i + " took " + (then-now) + "ms");
+       }
         
         // The timings for each should be about the same
         long avg = 0;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message