summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-14 15:08:22 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-14 15:51:24 -0500
commit1712337d4dbdca7453a8ff701d429637edb9934b (patch)
tree80ddfae563a3370a8941b95a0c3bc8c8df7998ca /sfx2
parent8bab53a19828b888ca689dafaf98aa3ba82228a8 (diff)
Add new unit test to test pivot table functionalities via ScDBDocFunc.
This change also introduces the following changes: 1) Special initialization routine just for the unit test runs. In particular, SfxMedium instance needs to be set even for a brand-new document (as in the actual run-time), or else the document would be always labeled "read-only". This prevented us from testing various code in Calc, which this commit fixes. 2) Several cppunit checks that checked for incorrect results, which passed because we happened to be getting those incorrect results due to the issue with the SfxMedium instance not being set. 3) Unfortunately now the test for cell function MATCH fails for some mysterious reason. The test is disabled temporarily until we figure this out. Change-Id: If231fd99e0ffddcd74f65c7cb5476e7a25f0ac7d
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/objsh.hxx6
-rw-r--r--sfx2/source/doc/objstor.cxx6
2 files changed, 12 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 8e1e2f6e0246..6a7dfb51fd08 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -292,6 +292,12 @@ public:
void AddLog( const ::rtl::OUString& aMessage );
void StoreLog();
+ /**
+ * Initialize bare minimum just enough for unit test runs.
+ *
+ * @return true if the initialization is successful, false otherwise.
+ */
+ bool DoInitUnitTest();
sal_Bool DoInitNew( SfxMedium* pMedium=0 );
sal_Bool DoLoad( SfxMedium* pMedium );
bool DoLoadExternal(SfxMedium* pMed, const rtl::OUString& rProvider);
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 059bf5b20eb6..1a03a3bd0ad7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -447,6 +447,12 @@ sal_Bool SfxObjectShell::Load( SfxMedium& rMedium )
return GeneralInit_Impl( rMedium.GetStorage(), sal_True );
}
+bool SfxObjectShell::DoInitUnitTest()
+{
+ pMedium = new SfxMedium;
+ return true; // always a success!
+}
+
sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
/* [Description]