1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
10 #include <sal/config.h>
12 #include <cppunit/TestAssert.h>
13 #include <cppunit/TestFixture.h>
14 #include <cppunit/extensions/HelperMacros.h>
16 #include <o3tl/temporary.hxx>
20 void modify(int& n
) { n
= 1; }
22 class Test
: public CppUnit::TestFixture
25 CPPUNIT_TEST_SUITE(Test
);
26 CPPUNIT_TEST(testLvalue
);
27 CPPUNIT_TEST_SUITE_END();
34 CPPUNIT_ASSERT_EQUAL(1, n
);
38 modify(o3tl::temporary(int(n
)));
39 CPPUNIT_ASSERT_EQUAL(0, n
);
44 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */