bump product version to 5.0.4.1
[LibreOffice.git] / sal / qa / rtl / bootstrap / expand.cxx
blobb1eb23b82543663bdae62cd10161a26462b1a1ac
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #include "sal/config.h"
12 #include "cppunit/TestAssert.h"
13 #include "cppunit/TestFixture.h"
14 #include "cppunit/extensions/HelperMacros.h"
15 #include "cppunit/plugin/TestPlugIn.h"
16 #include "rtl/bootstrap.hxx"
17 #include "rtl/ustring.hxx"
19 namespace {
21 class Test: public CppUnit::TestFixture {
22 public:
23 virtual void setUp() SAL_OVERRIDE;
25 private:
26 CPPUNIT_TEST_SUITE(Test);
27 CPPUNIT_TEST(testDollar);
28 CPPUNIT_TEST(testIndirectDollar);
29 CPPUNIT_TEST_SUITE_END();
31 void testDollar();
33 void testIndirectDollar();
36 void Test::setUp() {
37 rtl::Bootstrap::set("TEST", "<expanded TEST>");
38 rtl::Bootstrap::set("WITH_DOLLAR", "foo\\$TEST");
39 rtl::Bootstrap::set("INDIRECT", "$WITH_DOLLAR");
42 void Test::testDollar() {
43 rtl::OUString s("$WITH_DOLLAR");
44 rtl::Bootstrap::expandMacros(s);
45 CPPUNIT_ASSERT_EQUAL(rtl::OUString("foo$TEST"), s);
48 void Test::testIndirectDollar() {
49 rtl::OUString s("$INDIRECT");
50 rtl::Bootstrap::expandMacros(s);
51 CPPUNIT_ASSERT_EQUAL(rtl::OUString("foo$TEST"), s);
54 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
58 CPPUNIT_PLUGIN_IMPLEMENT();
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */