[Libreoffice-commits] .: sc/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 1 08:14:46 PDT 2012
sc/qa/unit/ucalc.cxx | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
New commits:
commit 10742e6eed87d33bf7619ce7819036b0545f0102
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu Nov 1 11:12:40 2012 -0400
Unit test for cache filtering, to secure the recent bug fix I did.
Change-Id: Ie5068b45520b6c82af41062d97ec65d006b4b3ba
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 74c7205..b489cb7 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -62,6 +62,7 @@
#include "dpsave.hxx"
#include "dpdimsave.hxx"
#include "dpcache.hxx"
+#include "dpfilteredcache.hxx"
#include "calcconfig.hxx"
#include "interpre.hxx"
@@ -82,6 +83,7 @@
#include <com/sun/star/sheet/GeneralFunction.hpp>
#include <iostream>
+#include <sstream>
#include <vector>
#define CALC_DEBUG_OUTPUT 0
@@ -2420,6 +2422,29 @@ void Test::testPivotTableCache()
}
}
+ // Now, on to testing the filtered cache.
+
+ {
+ // Non-filtered cache - everything should be visible.
+ ScDPFilteredCache aFilteredCache(aCache);
+ aFilteredCache.fillTable();
+
+ sal_Int32 nRows = aFilteredCache.getRowSize();
+ CPPUNIT_ASSERT_MESSAGE("Wrong dimension.", nRows == 6 && aFilteredCache.getColSize() == 3);
+
+ for (sal_Int32 i = 0; i < nRows; ++i)
+ {
+ if (!aFilteredCache.isRowActive(i))
+ {
+ std::ostringstream os;
+ os << "Row " << i << " should be visible but it isn't.";
+ CPPUNIT_ASSERT_MESSAGE(os.str().c_str(), false);
+ }
+ }
+ }
+
+ // TODO : Add test for filtered caches.
+
m_pDoc->DeleteTab(0);
}
More information about the Libreoffice-commits
mailing list