diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-17 18:03:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-18 21:57:18 +0100 |
commit | fe5c763250690cac53550b576f8a793f2d20a791 (patch) | |
tree | 90dbcebc9a6387aa4a49bc73b9330a012d314e04 /sc | |
parent | c4d2710c1c42714fd95e99f6f1e1627bfe8881e1 (diff) |
Don't let testSpreadsheetViewSettingsProperties interfere with existing tests
...by giving each test its own mxComponent.
At least my Windows builds started to fail CppunitTest_sc_tabviewobj with
> C:/lo/core/test/source/sheet/xviewsplitable.cxx:36:sc_apitest::ScTabViewObj::testSplit
> equality assertion failed
> - Expected: 1
> - Actual : 0
> - Wrong column
after 95307f2ca73480176634e5cc46d96a19b735e87b "tdf#45904 Move
_SpreadsheetViewSettings Java tests to C++" added the call to
testSpreadsheetViewSettingsProperties ahead of the call to testSplit. (And
allowing multiple tests to work on shared state and interfere like they
apparently do here seems rather brittle in general.)
Change-Id: I73a60ae3c703e59852c8e16b09f5897849f5bdf4
Reviewed-on: https://gerrit.libreoffice.org/48070
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/sctabviewobj.cxx | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sc/qa/extras/sctabviewobj.cxx b/sc/qa/extras/sctabviewobj.cxx index 4a8cbfe2befb..2bc4c7b7031f 100644 --- a/sc/qa/extras/sctabviewobj.cxx +++ b/sc/qa/extras/sctabviewobj.cxx @@ -27,8 +27,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 4 - class ScTabViewObj : public CalcUnoApiTest, public apitest::SpreadsheetViewSettings, public apitest::XSpreadsheetView, @@ -59,14 +57,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScTabViewObj::nTest = 0; -uno::Reference< lang::XComponent > ScTabViewObj::mxComponent; - ScTabViewObj::ScTabViewObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -74,9 +67,6 @@ ScTabViewObj::ScTabViewObj() uno::Reference< uno::XInterface > ScTabViewObj::init() { - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xSheetDoc.is()); @@ -87,19 +77,13 @@ uno::Reference< uno::XInterface > ScTabViewObj::init() void ScTabViewObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScTabViewObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |