Properly #ifdef some per-platform test code

Change-Id: I286fb35e223f205ecc649aa388471ef1b0823d86
This commit is contained in:
Stephan Bergmann 2014-04-15 23:29:14 +02:00
parent 78fcb7f256
commit 1f742c520d
5 changed files with 31 additions and 0 deletions

View File

@ -36,9 +36,11 @@ class ScMacrosTest : public UnoApiTest
public:
ScMacrosTest();
#if !defined MACOSX
void testStarBasic();
void testVba();
void testMSP();
#endif
CPPUNIT_TEST_SUITE(ScMacrosTest);
#if !defined(MACOSX)
//enable this test if you want to play with star basic macros in unit tests
@ -54,6 +56,8 @@ private:
uno::Reference<uno::XInterface> m_xCalcComponent;
};
#if !defined MACOSX
// I suppose you could say this test doesn't really belong here, OTOH
// we need a full document to run the test ( it related originally to an
// imported Excel VBA macro ) It's convenient and fast to unit test
@ -276,6 +280,8 @@ void ScMacrosTest::testVba()
}
}
#endif
ScMacrosTest::ScMacrosTest()
: UnoApiTest("/sc/qa/extras/testdocuments")
{

View File

@ -59,10 +59,14 @@ public:
virtual void setUp() SAL_OVERRIDE;
virtual void tearDown() SAL_OVERRIDE;
#if !defined MACOSX && !defined DRAGONFLY
ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, sal_uLong );
#endif
void test();
#if !defined MACOSX && !defined DRAGONFLY
void testPasswordExport();
#endif
void testConditionalFormatExportODS();
void testConditionalFormatExportXLSX();
void testColorScaleExportODS();
@ -132,6 +136,7 @@ private:
};
#if !defined MACOSX && !defined DRAGONFLY
ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUString &rFilter,
const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType)
{
@ -168,6 +173,7 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt
OUString aPass("test");
return load(aTempFile.GetURL(), rFilter, rUserData, rTypeName, nFormatType, nFormat, SOFFICE_FILEFORMAT_CURRENT, &aPass);
}
#endif
void ScExportTest::test()
{
@ -190,6 +196,7 @@ void ScExportTest::test()
ASSERT_DOUBLES_EQUAL(aVal, 1.0);
}
#if !defined MACOSX && !defined DRAGONFLY
void ScExportTest::testPasswordExport()
{
ScDocShell* pShell = new ScDocShell(
@ -215,6 +222,7 @@ void ScExportTest::testPasswordExport()
xDocSh->DoClose();
}
#endif
void ScExportTest::testConditionalFormatExportODS()
{

View File

@ -136,9 +136,11 @@ public:
void testRowIndex1BasedXLSX();
//misc tests unrelated to the import filters
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
void testPasswordNew();
void testPasswordOld();
void testPasswordWrongSHA();
#endif
//test shape import
void testControlImport();
@ -247,7 +249,10 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
void testPassword_Impl(const OUString& rFileNameBase);
#endif
uno::Reference<uno::XInterface> m_xCalcComponent;
};
@ -1486,6 +1491,7 @@ void ScFiltersTest::testRowIndex1BasedXLSX()
xDocSh->DoClose();
}
#if !defined(MACOSX) && !defined(DRAGONFLY) && !defined(WNT)
void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase)
{
OUString aFileExtension(getFileFormats()[0].pName, strlen(getFileFormats()[0].pName), RTL_TEXTENCODING_UTF8 );
@ -1541,6 +1547,7 @@ void ScFiltersTest::testPasswordWrongSHA()
const OUString aFileNameBase("passwordWrongSHA.");
testPassword_Impl(aFileNameBase);
}
#endif
void ScFiltersTest::testControlImport()
{

View File

@ -51,13 +51,17 @@ class SwMacrosTest : public test::BootstrapFixture, public unotest::MacrosTest
public:
SwMacrosTest();
#if !defined MACOSX && !defined WNT
void createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath);
#endif
virtual void setUp() SAL_OVERRIDE;
virtual void tearDown() SAL_OVERRIDE;
//void testStarBasic();
#if !defined MACOSX && !defined WNT
void testVba();
#endif
void testFdo55289();
CPPUNIT_TEST_SUITE(SwMacrosTest);
#if !defined(MACOSX) && !defined(WNT)
@ -75,6 +79,7 @@ private:
OUString m_aBaseString;
};
#if !defined MACOSX && !defined WNT
void SwMacrosTest::createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath)
{
OUString aSep("/");
@ -83,6 +88,7 @@ void SwMacrosTest::createFileURL(const OUString& aFileBase, const OUString& aFil
aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
rFilePath = aBuffer.makeStringAndClear();
}
#endif
#if 0
@ -113,6 +119,7 @@ void SwMacrosTest::testStarBasic()
#endif
#if !defined MACOSX && !defined WNT
void SwMacrosTest::testVba()
{
TestMacroInfo testInfo[] = {
@ -148,6 +155,7 @@ void SwMacrosTest::testVba()
pFoundShell->DoClose();
}
}
#endif
void SwMacrosTest::testFdo55289()
{

View File

@ -84,6 +84,7 @@ public:
protected:
/// Copy&paste helper.
#if !defined MACOSX && !defined WNT
void paste(const OUString& aFilename, uno::Reference<text::XTextRange> xTextRange = uno::Reference<text::XTextRange>())
{
uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.RtfFilter"), uno::UNO_QUERY_THROW);
@ -103,6 +104,7 @@ protected:
}
xFilter->filter(aDescriptor);
}
#endif
AllSettings m_aSavedSettings;
};