diff options
author | Muthu Subramanian <sumuthu@collabora.com> | 2013-11-13 20:45:18 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@collabora.com> | 2013-11-13 20:58:30 +0530 |
commit | 5656393f02ddd501d60673b0686688156336f0ee (patch) | |
tree | 7e7e014ef495df04d235368592b01ee200f26c54 /sd/qa | |
parent | 9694f8bc26fec366d518ce913a1a48b69fadf26c (diff) |
Add export unit test helper to testDocumentLayout.
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 21 | ||||
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 4 |
2 files changed, 14 insertions, 11 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2a7de2de4257..686281586156 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -88,16 +88,17 @@ the test, and re-running; it should break. */ void SdFiltersTest::testDocumentLayout() { - struct { const char *pInput, *pDump; } aFilesToCompare[] = + struct { const char *pInput, *pDump; sal_Int32 nExportType; } aFilesToCompare[] = { - { "odp/shapes-test.odp", "xml/shapes-test_page" }, - { "pptx/fdo47434-all.pptx", "pptx/xml/fdo47434_page" }, - { "n758621.ppt", "xml/n758621_" }, - { "fdo64586.ppt", "xml/fdo64586_" }, - { "n819614.pptx", "xml/n819614_" }, - { "n820786.pptx", "xml/n820786_" }, - { "n762695.pptx", "xml/n762695_" }, - { "n593612.pptx", "xml/n593612_" }, + { "odp/shapes-test.odp", "xml/shapes-test_page", -1 }, + { "pptx/fdo47434-all.pptx", "pptx/xml/fdo47434_page", -1 }, + { "n758621.ppt", "xml/n758621_", -1 }, + { "fdo64586.ppt", "xml/fdo64586_", -1 }, + { "n819614.pptx", "xml/n819614_", -1 }, + { "n820786.pptx", "xml/n820786_", -1 }, + { "n762695.pptx", "xml/n762695_", -1 }, + { "n593612.pptx", "xml/n593612_", -1 }, + // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX }, // Example }; for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) ); ++i ) @@ -105,6 +106,8 @@ void SdFiltersTest::testDocumentLayout() int nUpdateMe = -1; // index of test we want to update; supposedly only when the test is created ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ) ); + if( aFilesToCompare[i].nExportType >= 0 ) + xDocShRef = saveAndReload( xDocShRef, aFilesToCompare[i].nExportType ); compareWithShapesDump( xDocShRef, getPathFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pDump ), i == nUpdateMe ); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 6c05ffafc623..00b589284a5e 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -120,10 +120,10 @@ protected: return xDocShRef; } - ::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_uLong nExportType ) + ::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_Int32 nExportType ) { FileFormat *pFmt = &aFileFormats[0]; - if( nExportType < SAL_N_ELEMENTS( aFileFormats ) ) + if( ( (sal_uInt32) nExportType ) < SAL_N_ELEMENTS( aFileFormats ) ) pFmt = &aFileFormats[ nExportType ]; OUString aExt = OUString( "." ) + OUString::createFromAscii( pFmt->pName ); utl::TempFile aTempFile( OUString(), &aExt ); |