Bump version to 24.04.3.4
[LibreOffice.git] / sal / qa / rtl / bootstrap / expand.cxx
blob46ea08b331c63f0715589240e00b021b40974f33
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 <rtl/bootstrap.hxx>
16 #include <rtl/ustring.hxx>
18 namespace {
20 class Test: public CppUnit::TestFixture {
21 public:
22 virtual void setUp() override;
24 private:
25 CPPUNIT_TEST_SUITE(Test);
26 CPPUNIT_TEST(testDollar);
27 CPPUNIT_TEST(testIndirectDollar);
28 CPPUNIT_TEST_SUITE_END();
30 void testDollar();
32 void testIndirectDollar();
35 void Test::setUp() {
36 rtl::Bootstrap::set("TEST", "<expanded TEST>");
37 rtl::Bootstrap::set("WITH_DOLLAR", "foo\\$TEST");
38 rtl::Bootstrap::set("INDIRECT", "$WITH_DOLLAR");
41 void Test::testDollar() {
42 OUString s("$WITH_DOLLAR");
43 rtl::Bootstrap::expandMacros(s);
44 CPPUNIT_ASSERT_EQUAL(OUString("foo$TEST"), s);
47 void Test::testIndirectDollar() {
48 OUString s("$INDIRECT");
49 rtl::Bootstrap::expandMacros(s);
50 CPPUNIT_ASSERT_EQUAL(OUString("foo$TEST"), s);
53 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */