Ocean
testcv/testdetector/testqrcodes/TestUtilities.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 #pragma once
9 
11 
13 
14 namespace Ocean
15 {
16 
17 namespace Test
18 {
19 
20 namespace TestCV
21 {
22 
23 namespace TestDetector
24 {
25 
26 namespace TestQRCodes
27 {
28 
29 /**
30  * This class implements tests for the utility functions of the QR code library.
31  * @ingroup testcvdetectorqrcodes
32  */
33 class OCEAN_TEST_CV_DETECTOR_QRCODES_EXPORT TestUtilities : protected CV::Detector::QRCodes::Utilities
34 {
35  public:
36 
37  /**
38  * Tests the functions of the QR code utilities.
39  * @param testDuration Number of seconds for each test, with range (0, infinity)
40  * @return True, if succeeded
41  */
42  static bool test(const double testDuration);
43 
44  /**
45  * Test for the check if a QR code is contained in a list of existing QR codes (without poses)
46  * @param testDuration Number of seconds for each test, with range (0, infinity)
47  * @return True, if succeeded
48  */
49  static bool testContainsCode(const double testDuration);
50 
51  /**
52  * Tests the parsing of a Wi-Fi configuration stored as a string
53  * @param testDuration Number of seconds for each test, with range (0, infinity)
54  * @return True, if succeeded
55  */
56  static bool stressTestParseWifiConfig(const double testDuration);
57 
58  /**
59  * Tests the parsing of a Wi-Fi configuration stored as a string
60  * @param testDuration Number of seconds for each test, with range (0, infinity)
61  * @return True, if succeeded
62  */
63  static bool testParseWifiConfig(const double testDuration);
64 
65  /**
66  * Tests the escaping of special characters in a string
67  * @param testDuration Number of seconds for each test, with range (0, infinity)
68  * @return True, if succeeded
69  */
70  static bool testEscapeSpecialCharacters(const double testDuration);
71 
72  /**
73  * Tests the unescaping of special characters in a string
74  * @param testDuration Number of seconds for each test, with range (0, infinity)
75  * @return True, if succeeded
76  */
77  static bool testUnescapeSpecialCharacters(const double testDuration);
78 
79  protected:
80 
81  /**
82  * Validates the escaping of special characters in a string
83  * @param string The string in which the special characters will be escaped, must be valid
84  * @param specialCharacters The list of characters that will be escaped in the string, must be valid
85  * @param testEscapedString The escaped string that will be tested for validity, must be valid
86  * @return True if the validation was successful, otherwise false
87  */
88  static bool validateEscapeSpecialCharacters(const std::string& string, const std::string& specialCharacters, const std::string& testEscapedString);
89 };
90 
91 } // namespace TestQRCodes
92 
93 } // namespace TestDetector
94 
95 } // namespace TestCV
96 
97 } // namespace Test
98 
99 } // namepace Test
Definition of utility functions related to the detection of QR codes.
Definition: cv/detector/qrcodes/Utilities.h:42
This class implements tests for the utility functions of the QR code library.
Definition: testcv/testdetector/testqrcodes/TestUtilities.h:34
static bool validateEscapeSpecialCharacters(const std::string &string, const std::string &specialCharacters, const std::string &testEscapedString)
Validates the escaping of special characters in a string.
static bool testContainsCode(const double testDuration)
Test for the check if a QR code is contained in a list of existing QR codes (without poses)
static bool testEscapeSpecialCharacters(const double testDuration)
Tests the escaping of special characters in a string.
static bool testParseWifiConfig(const double testDuration)
Tests the parsing of a Wi-Fi configuration stored as a string.
static bool stressTestParseWifiConfig(const double testDuration)
Tests the parsing of a Wi-Fi configuration stored as a string.
static bool testUnescapeSpecialCharacters(const double testDuration)
Tests the unescaping of special characters in a string.
static bool test(const double testDuration)
Tests the functions of the QR code utilities.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15