1 /* Copyright (C) 2012 The libsigc++ Development Team
3 * This file is part of libsigc++.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 // Functions used in several test cases in libsigc++.
23 // This is a singleton class.
29 TestUtilities(const TestUtilities&) = delete;
30 TestUtilities& operator=(const TestUtilities&) = delete;
33 TestUtilities(TestUtilities&&) = delete;
34 TestUtilities& operator=(TestUtilities&&) = delete;
36 static TestUtilities* get_instance();
37 bool check_command_args(int argc, char* argv[]);
38 void check_result(std::ostringstream& result_stream, const std::string& expected_result);
39 bool get_verbose() const { return verbose_; }
40 bool get_result() const { return result_ok_; }
42 // When you are searching for memory leaks with valgrind or a similar program,
43 // you avoid a harmless warning by deleting the instance when you're done with it.
44 static bool get_result_and_delete_instance();
51 static TestUtilities* instance_;