1 /*
2  * Copyright (C) 2006-2021 Registro.br. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  * 1. Redistribution of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
16  * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
19  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
21  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23  * DAMAGE.
24  */
25 /* $Id$ */
26 /** @file StrUtilTest.H
27  *  @brief StrUtil Test Library
28  */
29 
30 #ifndef __UTILS_TEST_H__
31 #define __UTILS_TEST_H__
32 
33 #include <cppunit/TestResult.h>
34 #include <cppunit/TestSuite.h>
35 #include <cppunit/TestFixture.h>
36 #include <cppunit/TestRunner.h>
37 #include <cppunit/extensions/HelperMacros.h>
38 
39 using namespace CppUnit;
40 
41 /// StrUtil Test Class
42 class StrUtilTest : public CppUnit::TestFixture
43 {
44 public:
45 	/// Constructor
46 	StrUtilTest();
47 
48 	/// Destructor
49 	~StrUtilTest();
50 
51 	/// Allocate resources
52 	void setUp();
53 
54 	/// Release resources
55 	void tearDown();
56 
57 	/// Test parse method
58 	void parse_test();
59 
60 	/// Test gsub method
61 	void gsub_test();
62 
63 	/// Test to_string method
64 	void to_string_test();
65 
66 	/// Test iso88591_to_utf8 method
67 	void iso88591_to_utf8_test();
68 
69 	/// Test utf8_to_iso88591 method
70 	void utf8_to_iso88591_test();
71 
72 	/// Test XML Beautifier method
73 	void xml_beautifier_test();
74 
75 	/// Text esc_xml_markup method
76 	void xml_escape_test();
77 
78 	// Test string trim
79 	void trim_test();
80 
81 private:
82 
83 	CPPUNIT_TEST_SUITE(StrUtilTest);
84 	CPPUNIT_TEST(parse_test);
85 	CPPUNIT_TEST(gsub_test);
86 	CPPUNIT_TEST(to_string_test);
87 	CPPUNIT_TEST(iso88591_to_utf8_test);
88 	CPPUNIT_TEST(utf8_to_iso88591_test);
89 	CPPUNIT_TEST(xml_beautifier_test);
90 	CPPUNIT_TEST(xml_escape_test);
91 	CPPUNIT_TEST(trim_test);
92 	CPPUNIT_TEST_SUITE_END();
93 };
94 
95 #endif
96