diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-17 18:17:33 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-17 20:52:35 +0100 |
commit | 73a808f6b300fddcaab1d3c916d92785a1801d63 (patch) | |
tree | 9ce7df6c939cff99deea9f5a1f09cad2c2ec566e /unotest/source | |
parent | 25dc9aaf693ba1e4aac75659f0762f5169c10f28 (diff) |
test::FiltersTest: add support for export tests
For now, this is only implemented for the Writer RTF filter.
Change-Id: I0c7ae5b0e544bd4738652a38474f4d262ce65661
Diffstat (limited to 'unotest/source')
-rw-r--r-- | unotest/source/cpp/filters-test.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx index 3b613f338aa1..2b07ff8c3b4b 100644 --- a/unotest/source/cpp/filters-test.cxx +++ b/unotest/source/cpp/filters-test.cxx @@ -53,7 +53,7 @@ void decode(const OUString& rIn, const OUString &rOut) void FiltersTest::recursiveScan(filterStatus nExpected, const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, - unsigned int nClipboardID, unsigned int nFilterVersion) + unsigned int nClipboardID, unsigned int nFilterVersion, bool bExport) { osl::Directory aDir(rURL); @@ -67,7 +67,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected, if (aFileStatus.getFileType() == osl::FileStatus::Directory) { recursiveScan(nExpected, rFilter, sURL, rUserData, - nFilterFlags, nClipboardID, nFilterVersion); + nFilterFlags, nClipboardID, nFilterVersion, bExport); } else { @@ -106,8 +106,13 @@ void FiltersTest::recursiveScan(filterStatus nExpected, //the hanging input file is visible fprintf(stderr, "%s,", aRes.getStr()); sal_uInt32 nStartTime = osl_getGlobalTimer(); - bool bRes = load(rFilter, sURL, rUserData, nFilterFlags, - nClipboardID, nFilterVersion); + bool bRes; + if (!bExport) + bRes = load(rFilter, sURL, rUserData, nFilterFlags, + nClipboardID, nFilterVersion); + else + bRes = save(rFilter, sURL, rUserData, nFilterFlags, + nClipboardID, nFilterVersion); sal_uInt32 nEndTime = osl_getGlobalTimer(); if (bEncrypted) @@ -126,18 +131,18 @@ void FiltersTest::recursiveScan(filterStatus nExpected, void FiltersTest::testDir(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, unsigned int nFilterFlags, unsigned int nClipboardID, - unsigned int nFilterVersion) + unsigned int nFilterVersion, bool bExport) { fprintf(stderr, "File tested,Test Result,Execution Time (ms)\n"); recursiveScan(test::pass, rFilter, rURL + "pass", - rUserData, nFilterFlags, nClipboardID, nFilterVersion); + rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport); recursiveScan(test::fail, rFilter, rURL + "fail", - rUserData, nFilterFlags, nClipboardID, nFilterVersion); + rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport); recursiveScan(test::indeterminate, rFilter, rURL + "indeterminate", - rUserData, nFilterFlags, nClipboardID, nFilterVersion); + rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport); } } |