[Libreoffice-commits] .: lotuswordpro/qa
Jan Holesovsky
kendy at kemper.freedesktop.org
Thu Apr 28 07:32:20 PDT 2011
lotuswordpro/qa/cppunit/test_lotuswordpro.cxx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 9be13a6bb7165b767bfc457f80b02cd40082ecf5
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Apr 28 16:30:43 2011 +0200
Fix lotuswordpro unit test to be able to access the files.
[When building from tail_build.]
diff --git a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
index bb481bd..5591655 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);
}
More information about the Libreoffice-commits
mailing list