Ocean
Loading...
Searching...
No Matches
TestString.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTBASE_TEST_STRING_H
9#define META_OCEAN_TEST_TESTBASE_TEST_STRING_H
10
13
14namespace Ocean
15{
16
17namespace Test
18{
19
20namespace TestBase
21{
22
23/**
24 * This class implements a test for the string class.
25 * @ingroup testbase
26 */
27class OCEAN_TEST_BASE_EXPORT TestString
28{
29 protected:
30
31 /**
32 * Definition of a pair combining two strings.
33 * @tparam The data type of the character to be used
34 */
35 template <typename T>
36 using StringPair = std::pair<std::basic_string<T>, std::basic_string<T>>;
37
38 /**
39 * Definition of a vector holding string pairs.
40 * @tparam The data type of the character to be used
41 */
42 template <typename T>
43 using StringPairs = std::vector<StringPair<T>>;
44
45 public:
46
47 /**
48 * Tests the string functionalities.
49 * @param testDuration Number of seconds for each test, with range (0, infinity)
50 * @param selector The test selector to filter tests
51 * @return True, if succeeded
52 */
53 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
54
55 /**
56 * Tests the toAString() function.
57 * @return True, if succeeded
58 */
59 static bool testToAString();
60
61 /**
62 * Tests the towString() function.
63 * @return True, if succeeded
64 */
65 static bool testToWString();
66
67 /**
68 * Tests the boolean value function.
69 * @return True, if succeeded
70 */
71 static bool testIsBoolean();
72
73 /**
74 * Tests the integer value function.
75 * @return True, if succeeded
76 */
77 static bool testIsInteger32();
78
79 /**
80 * Tests the unsigned integer 64bit value function.
81 * @return True, if succeeded
82 */
84
85 /**
86 * Tests the hex value function for 64 bit.
87 * @return True, if succeeded
88 */
89 static bool testIsHexValue64();
90
91 /**
92 * Tests the number value function.
93 * @return True, if succeeded
94 */
95 static bool testIsNumber();
96
97 /**
98 * Tests the trim functions.
99 * @param testDuration Number of seconds for each test, with range (0, infinity)
100 * @return True, if succeeded
101 */
102 static bool testTrim(const double testDuration);
103
104 /**
105 * Tests the replace functions.
106 * @return True, if succeeded
107 */
108 static bool testReplace();
109
110 /**
111 * Tests the to-lower function.
112 * @return True, if succeeded
113 */
114 static bool testToLower();
115
116 /**
117 * Tests the to-upper function.
118 * @return True, if succeeded
119 */
120 static bool testToUpper();
121};
122
123}
124
125}
126
127}
128
129#endif // META_OCEAN_TEST_TESTBASE_TEST_STRING_H
This class implements a test for the string class.
Definition TestString.h:28
static bool testIsInteger32()
Tests the integer value function.
static bool testIsUnsignedInteger64()
Tests the unsigned integer 64bit value function.
static bool testToUpper()
Tests the to-upper function.
std::pair< std::basic_string< T >, std::basic_string< T > > StringPair
Definition of a pair combining two strings.
Definition TestString.h:36
static bool testTrim(const double testDuration)
Tests the trim functions.
static bool testIsNumber()
Tests the number value function.
static bool testReplace()
Tests the replace functions.
std::vector< StringPair< T > > StringPairs
Definition of a vector holding string pairs.
Definition TestString.h:43
static bool testIsHexValue64()
Tests the hex value function for 64 bit.
static bool testIsBoolean()
Tests the boolean value function.
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Tests the string functionalities.
static bool testToWString()
Tests the towString() function.
static bool testToLower()
Tests the to-lower function.
static bool testToAString()
Tests the toAString() function.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15