summaryrefslogtreecommitdiff
path: root/sc/qa/unit/filters-test.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-10-19 15:18:38 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-10-19 15:23:18 +0200
commit9132e6ffa7b51375ee90f14226ab3eb08ba5e85c (patch)
treedcaeb869959be1125fabba2fc976cb4df6234736 /sc/qa/unit/filters-test.cxx
parenta47ef216cc68e3101f25e31ad783b02bb981e9bf (diff)
separate normal calc filter tests and macro tests
this should make it easier to deal with the increased complexity in the unit tests for vba and star basic we should not mess with the normal calc tests while working on advanced vba and basic tests
Diffstat (limited to 'sc/qa/unit/filters-test.cxx')
-rw-r--r--sc/qa/unit/filters-test.cxx72
1 files changed, 0 insertions, 72 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 939109ee46fc..8292c3821627 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -171,9 +171,6 @@ public:
void testBugFixesXLS();
void testBugFixesXLSX();
- void testStarBasic();
- void testVba();
-
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST(testRangeName);
@@ -185,13 +182,6 @@ public:
CPPUNIT_TEST(testBugFixesODS);
CPPUNIT_TEST(testBugFixesXLS);
CPPUNIT_TEST(testBugFixesXLSX);
- //enable this test if you want to play with star basic macros in unit tests
- //works but does nothing useful yet
- CPPUNIT_TEST(testStarBasic);
- //enable if you want to hack vba support for unit tests
- //does not work, still problems during loading
- //CPPUNIT_TEST(testVba);
-
CPPUNIT_TEST_SUITE_END();
@@ -624,68 +614,6 @@ void ScFiltersTest::testBugFixesXLSX()
xDocSh->DoClose();
}
-void ScFiltersTest::testStarBasic()
-{
- const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("StarBasic."));
- rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
- rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
- rtl::OUString aFileName;
- createFileURL(aFileNameBase, aFileExtension, aFileName);
- rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
- std::cout << aFileFormats[0].pName << " Test" << std::endl;
- ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[0].nFormatType);
-
- CPPUNIT_ASSERT_MESSAGE("Failed to load StarBasic.ods", xDocSh.Is());
-
- rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic&location=document"));
- String sUrl = aURL;
- Any aRet;
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< Any > aOutParam;
- Sequence< uno::Any > aParams;
- ScDocument* pDoc = xDocSh->GetDocument();
-
- xDocSh->CallXScript(sUrl, aParams, aRet, aOutParamIndex,aOutParam);
- double aValue;
- pDoc->GetValue(0,0,0,aValue);
- std::cout << aValue << std::endl;
- CPPUNIT_ASSERT_MESSAGE("script did not change the value of Sheet1.A1",aValue==2);
- xDocSh->DoClose();
-}
-
-void ScFiltersTest::testVba()
-{
- const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("vba."));
- rtl::OUString aFileExtension(aFileFormats[1].pName, strlen(aFileFormats[1].pName), RTL_TEXTENCODING_UTF8 );
- rtl::OUString aFilterName(aFileFormats[1].pFilterName, strlen(aFileFormats[1].pFilterName), RTL_TEXTENCODING_UTF8) ;
- rtl::OUString aFileName;
- createFileURL(aFileNameBase, aFileExtension, aFileName);
- rtl::OUString aFilterType(aFileFormats[1].pTypeName, strlen(aFileFormats[1].pTypeName), RTL_TEXTENCODING_UTF8);
- std::cout << aFileFormats[1].pName << " Test" << std::endl;
- ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[1].nFormatType);
-
- CPPUNIT_ASSERT_MESSAGE("Failed to load vba.xls", xDocSh.Is());
-
- //is it really the right way to call a vba macro through CallXScript?
- //it seems that the basic ide does it differently, but then we would need to init all parts ourself
- //the problem is that CallXScript inits the basic part
- ////BasicIDE::RunMethod takes an SbMethod as parametre
- rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.Star.script:VBAProject.Modul1.Modul1?language=Basic&location=document"));
- String sUrl = aURL;
- Any aRet;
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< Any > aOutParam;
- Sequence< uno::Any > aParams;
- ScDocument* pDoc = xDocSh->GetDocument();
-
- xDocSh->CallXScript(sUrl, aParams, aRet, aOutParamIndex,aOutParam);
- double aValue;
- pDoc->GetValue(0,0,0,aValue);
- std::cout << aValue << std::endl;
- CPPUNIT_ASSERT_MESSAGE("script did not change the value of Sheet1.A1",aValue==2);
- xDocSh->DoClose();
-}
-
ScFiltersTest::ScFiltersTest()
: m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))
{