summaryrefslogtreecommitdiff
path: root/lotuswordpro/qa
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-04-28 16:30:43 +0200
committerJan Holesovsky <kendy@suse.cz>2011-04-28 16:31:57 +0200
commitdaff075ae6726c328b163c2b464518b2353b6699 (patch)
treee2305e2246e9d1bca46122d4827701674aaa5f55 /lotuswordpro/qa
parent8465c9a0a15b25cb3db66a30f84d9728fb698ea2 (diff)
Fix lotuswordpro unit test to be able to access the files.
[When building from tail_build.]
Diffstat (limited to 'lotuswordpro/qa')
-rw-r--r--lotuswordpro/qa/cppunit/test_lotuswordpro.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
index bb481bdf3a19..55916559dedf 100644
--- a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
+++ b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
@@ -66,11 +66,11 @@ namespace
uno::Reference<lang::XMultiServiceFactory> m_xMSF;
uno::Reference<document::XFilter> m_xFilter;
- ::rtl::OUString m_aPWDURL;
+ ::rtl::OUString m_aSrcRoot;
int m_nLoadedDocs;
};
- LotusWordProTest::LotusWordProTest() : m_nLoadedDocs(0)
+ LotusWordProTest::LotusWordProTest() : m_aSrcRoot( RTL_CONSTASCII_USTRINGPARAM( "file://" ) ), m_nLoadedDocs(0)
{
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
m_xFactory = m_xContext->getServiceManager();
@@ -79,8 +79,10 @@ namespace
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.LotusWordProImportFilter"))),
uno::UNO_QUERY_THROW);
- oslProcessError err = osl_getProcessWorkingDir(&m_aPWDURL.pData);
- CPPUNIT_ASSERT_MESSAGE("no PWD!", err == osl_Process_E_None);
+ const char* pSrcRoot = getenv( "SRC_ROOT" );
+ CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
+
+ m_aSrcRoot += rtl::OUString::createFromAscii( pSrcRoot );
//Without this we're crashing because callees are using
//getProcessServiceFactory. In general those should be removed in favour
@@ -141,8 +143,8 @@ namespace
void LotusWordProTest::test()
{
- recursiveScan(m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/qa/cppunit/data/pass")), true);
- recursiveScan(m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/qa/cppunit/data/fail/")), false);
+ recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/lotuswordpro/qa/cppunit/data/pass")), true);
+ recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/lotuswordpro/qa/cppunit/data/fail/")), false);
printf("LotusWordPro: tested %d files\n", m_nLoadedDocs);
}