LCOV - code coverage report
Current view: top level - svx/qa/unit/svdraw - test_SdrTextObject.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 19 19 100.0 %
Date: 2015-06-13 12:38:46 Functions: 13 14 92.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #include <svx/svdotext.hxx>
      11             : #include <rtl/ustring.hxx>
      12             : 
      13             : #include <cppunit/TestAssert.h>
      14             : #include <cppunit/TestFixture.h>
      15             : #include <cppunit/extensions/HelperMacros.h>
      16             : #include <cppunit/plugin/TestPlugIn.h>
      17             : 
      18           3 : class SdrTextObjTest : public CppUnit::TestFixture {
      19             : public:
      20             :     void AllFamiliesCanBeRestoredFromSavedString();
      21             : 
      22           2 :     CPPUNIT_TEST_SUITE(SdrTextObjTest);
      23           1 :     CPPUNIT_TEST(AllFamiliesCanBeRestoredFromSavedString);
      24           5 :     CPPUNIT_TEST_SUITE_END();
      25             : };
      26             : 
      27           1 : void SdrTextObjTest::AllFamiliesCanBeRestoredFromSavedString() {
      28           1 :     std::vector<SfxStyleFamily> allFamilies;
      29           1 :     allFamilies.push_back(SFX_STYLE_FAMILY_CHAR);
      30           1 :     allFamilies.push_back(SFX_STYLE_FAMILY_PARA);
      31           1 :     allFamilies.push_back(SFX_STYLE_FAMILY_PAGE);
      32           1 :     allFamilies.push_back(SFX_STYLE_FAMILY_PSEUDO);
      33             : 
      34           5 :     for (SfxStyleFamily family : allFamilies) {
      35           4 :       OUString styleName = "styleName";
      36           4 :       SdrTextObj::AppendFamilyToStyleName(styleName, family);
      37           4 :       SfxStyleFamily readFamily = SdrTextObj::ReadFamilyFromStyleName(styleName);
      38           4 :       CPPUNIT_ASSERT_EQUAL(family, readFamily);
      39           5 :     }
      40           1 : }
      41             : 
      42           1 : CPPUNIT_TEST_SUITE_REGISTRATION(SdrTextObjTest);
      43             : 
      44           4 : CPPUNIT_PLUGIN_IMPLEMENT();
      45             : 
      46             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11