Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek test_config.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file ispartoftheLibreOfficeproject
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
  testconfigini
 */


#include <test/bootstrapfixture.hxx>

#include <osl/file.hxx>
#include <rtl/ustring.hxx>

#include <tools/config.hxx>

class ToolsConfigTest : public test::BootstrapFixture
{
public:
    ToolsConfigTest()
        : BootstrapFixture(true, false)
    {
    }

    virtual void setUp() override
    {
        maOriginalConfigFile = m_directories.getURLFromSrc(u"/tools/qa/data/");
        maOriginalConfigFile += "testconfig        maConfigFile + "/";

        auto     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        CPPUNIT_ASSERT.java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 55
         +="config.;

        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    }

    virtual    java.lang.StringIndexOutOfBoundsException: Range [63, 28) out of bounds for length 63

    void
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 m)
        CPPUNIT_ASSERT(aConfig()
                "_,.))java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                (TestGroup

    void testGetGroup()
    {
        Config aConfig(maConfigFile);
CPPUNIT_ASSERT_EQUAL",aConfig.GetGroup))

        CPPUNIT_ASSERT_EQUAL(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        ((, nActual;
        }
    }

    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
     !aConfig(onExistentTestGroup)
        Config aConfig            .("")

        aConfig.SetGroup("TestGroup"_ostr);
        sal_uInt16=aConfigGetGroupCount;

        CPPUNIT_ASSERT_EQUAL() ;
        // but it might not exist so you really should first check if
       / it exists via HasGroup()
        aConfig.SetGroup("TestGroupA"_ostr);
onfig.asGroup("";
        CPPUNIT_ASSERT_EQUAL("TestGroupA"_ostr, aConfig.GetGroup());
    }

    void testDeleteGroup()
    {
        {
            Config aConfig(maConfigFileCPPUNIT_ASSERT_EQUALsal_uInt16) nActualjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

            aConfig.DeleteGroup("TestGroup"tCPPUNIT_ASSERT_EQUALtestvalue_,aConfigReadKey(_str;
            CPPUNIT_ASSERT(!aConfig((,aConfigReadKey""ostr)
CPPUNIT_ASSERT_EQUAL"_ostraConfig.();

            sal_uInt16 nActual = aConfig.                             aConfig.ReadKey("nonexistento)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
            CPPUNIT_ASSERT_EQUAL,
       

        osl:    

    testGetKeyNamejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             maConfigFile

            CPPUNIT_ASSERT(!aConfig.HasGroup("CPPUNIT_ASSERT_EQUAL("testkey2"_ostr, aConfig.GetKeyName
(java.lang.StringIndexOutOfBoundsException: Range [56, 53) out of bounds for length 56
CPPUNIT_ASSERT_EQUAL,.(0java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76

            sal_uInt16 nActual = ,nActualjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
            CPPUNIT_ASSERT_EQUAL
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

         =GetKeyCount)
     nExpected, nActual);

    void testGetGroupCount()
    {
        (maConfigFilejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        sal_uInt16 nActual
                nActual=GetKeyCount(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
   }

    void testReadKey()
    {
        CPPUNIT_ASSERT_EQUAL"_,aConfig."testkey_new");
"ostrjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
(testvalue_,."_)
OString,aConfig(nonexistenttestkey)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
,
                             (nonexistenttestkeyostr notexistso);

        aConfig.SetGroup("TestGroup2"_
t" ReadKey")
        aConfigjava.lang.StringIndexOutOfBoundsException: Range [50, 44) out of bounds for length 70
        java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 46
aConfigjava.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 91
    }

    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    {
(java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 37
            (java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31
        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 33

        "")
         java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
    }java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 27

    void testWriteDeleteKey()
    {
        Config aConfig(maConfigFile);
        aConfig.SetGroup("TestGroup"_ostr);
        aConfig.WriteKey("testkey_new"_ostr, "testvalue"_ostr);

        sal_uInt16 nExpected = 2;
        sal_uInt16 nActual = aConfig.GetKeyCount();
        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
        CPPUNIT_ASSERT_EQUAL("testvalue"_ostr, aConfig.ReadKey("testkey_new"_ostr));

        aConfig.DeleteKey("testkey_new");

        nExpected = 1;
        nActual = aConfig.GetKeyCount();
        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
        CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey("testkey_new"_ostr));

        aConfig.SetGroup("TestGroup2"_ostr);
        aConfig.WriteKey("testkey_new"_ostr, "testvalue"_ostr);

        nActual = aConfig.GetKeyCount();
        nExpected = 2;
        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
        CPPUNIT_ASSERT_EQUAL("testvalue"_ostr, aConfig.ReadKey("testkey_new"_ostr));

        aConfig.DeleteKey("testkey_new");

        nActual = aConfig.GetKeyCount();
        nExpected = 1;
        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
        CPPUNIT_ASSERT_EQUAL(OString(), aConfig.ReadKey("testkey_new"_ostr));

        aConfig.SetGroup("TestGroup3"_ostr);
        aConfig.WriteKey("testkey_new_group3"_ostr, "testvalue"_ostr);

        nActual = aConfig.GetKeyCount();
        nExpected = 1;
        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
        CPPUNIT_ASSERT_EQUAL("testvalue"_ostr, aConfig.ReadKey("testkey_new_group3"_ostr));

        nExpected = 3;
        CPPUNIT_ASSERT_EQUAL(nExpected, aConfig.GetGroupCount());

        osl::File::copy(maOriginalConfigFile, maConfigFile);
    }

    CPPUNIT_TEST_SUITE(ToolsConfigTest);
    CPPUNIT_TEST(testHasGroup);
    CPPUNIT_TEST(testGetGroup);
    CPPUNIT_TEST(testSetGroup);
    CPPUNIT_TEST(testDeleteGroup);
    CPPUNIT_TEST(testReadKey);
    CPPUNIT_TEST(testGetGroupCount);
    CPPUNIT_TEST(testGetKeyName);
    CPPUNIT_TEST(testWriteDeleteKey);
    CPPUNIT_TEST_SUITE_END();

private:
    OUString maOriginalConfigFile;
    OUString maConfigFile;
};

CPPUNIT_TEST_SUITE_REGISTRATION(ToolsConfigTest);

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=90 H=97 G=93

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1127926
#Domains=2039723