diff options
| author | Manuel de la Pena <manuel@canonical.com> | 2012-12-11 14:35:33 +0100 |
|---|---|---|
| committer | Manuel de la Pena <manuel@canonical.com> | 2012-12-11 14:35:33 +0100 |
| commit | 0deba28329ffea282878b29f5d7697c7bc624aa6 (patch) | |
| tree | 9df4198730f5122c4be8e0f217ea37815204a86f /tests | |
| parent | d0b4342de8c3f2b4a8abc88e871da653295eb019 (diff) | |
Re-add the static cairo text fix.
(bzr r2956.2.10)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_static_cairo_text.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/test_static_cairo_text.cpp b/tests/test_static_cairo_text.cpp index 2553349ac..618af4f27 100644 --- a/tests/test_static_cairo_text.cpp +++ b/tests/test_static_cairo_text.cpp @@ -33,17 +33,33 @@ namespace class MockStaticCairoText : public nux::StaticCairoText { public: + MOCK_METHOD2(SetBaseSize, void(int, int)); + MockStaticCairoText():StaticCairoText("") {} using StaticCairoText::GetTextureStartIndices; using StaticCairoText::GetTextureEndIndices; + using StaticCairoText::PreLayoutManagement; }; -TEST(TestStaticCairoText, TextTextureSize) +class TestStaticCairoText : public ::testing::Test { + +protected: + TestStaticCairoText() : Test() + { + text = new MockStaticCairoText(); + } + + nux::ObjectPtr<MockStaticCairoText> text; + +}; + +TEST_F(TestStaticCairoText, TextTextureSize) +{ + EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(AnyNumber()); // Test multi-texture stitching support. - nux::ObjectPtr<MockStaticCairoText> text(new MockStaticCairoText()); text->SetLines(-2000); text->SetMaximumWidth(100); @@ -70,4 +86,16 @@ TEST(TestStaticCairoText, TextTextureSize) } } +TEST_F(TestStaticCairoText, TextPreLayoutManagementMultipleCalls) +{ + EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(2); + text->PreLayoutManagement(); + + // the first prelayout methods should have called set base size and therefore + // we should not call it again + + EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(0); + text->PreLayoutManagement(); +} + } |
