Ocean
Loading...
Searching...
No Matches
TestCVUtilities.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_TESTCV_TEST_CV_UTILITIES_H
9#define META_OCEAN_TEST_TESTCV_TEST_CV_UTILITIES_H
10
12
14
15namespace Ocean
16{
17
18namespace Test
19{
20
21namespace TestCV
22{
23
24/**
25 * This class implements tests for the CVUtilities class.
26 * @ingroup testcv
27 */
28class OCEAN_TEST_CV_EXPORT TestCVUtilities
29{
30 public:
31
32 /**
33 * Starts all tests of the CVUtilities class.
34 * @param testDuration Number of seconds for each test, with range (0, infinity)
35 * @param selector Test selector for filtering sub-tests; default runs all tests
36 * @return True, if succeeded
37 */
38 static bool test(const double testDuration, const TestSelector& selector = TestSelector());
39
40 /**
41 * Tests the definedPixelFormats() function.
42 * @return True, if succeeded
43 */
45
46 /**
47 * Tests the mirrorIndex() and mirrorOffset() helper functions.
48 * @return True, if succeeded
49 */
50 static bool testMirrorIndex();
51
52 /**
53 * Tests the isBorderZero() function.
54 * @param testDuration Number of seconds for the test, with range (0, infinity)
55 * @return True, if succeeded
56 */
57 static bool testIsBorderZero(const double testDuration);
58
59 /**
60 * Tests the isPaddingMemoryIdentical() function.
61 * @param testDuration Number of seconds for the test, with range (0, infinity)
62 * @return True, if succeeded
63 */
64 static bool testIsPaddingMemoryIdentical(const double testDuration);
65
66 /**
67 * Tests the createCheckerboardImage() function.
68 * @param testDuration Number of seconds for the test, with range (0, infinity)
69 * @return True, if succeeded
70 */
71 static bool testCheckerboardImage(const double testDuration);
72
73 /**
74 * Tests the randomizeFrame() / randomizedFrame() helpers.
75 * @param testDuration Number of seconds for the test, with range (0, infinity)
76 * @return True, if succeeded
77 */
78 static bool testRandomizedFrame(const double testDuration);
79
80 /**
81 * Tests the randomizedBinaryMask() helper.
82 * @param testDuration Number of seconds for the test, with range (0, infinity)
83 * @return True, if succeeded
84 */
85 static bool testRandomizedBinaryMask(const double testDuration);
86
87 /**
88 * Tests the copyPixel() helpers.
89 * @param testDuration Number of seconds for the test, with range (0, infinity)
90 * @return True, if succeeded
91 */
92 static bool testCopyPixel(const double testDuration);
93
94 /**
95 * Stress test: random indices through the mirrorIndex() function and
96 * verifies the index always lands inside [0, elements - 1].
97 * @param testDuration Number of seconds for the test, with range (0, infinity)
98 * @return True, if succeeded
99 */
100 static bool testMirrorIndexStress(const double testDuration);
101
102 /**
103 * Stress test: randomized large frame, randomly randomized many times
104 * across all defined data types, ensures padding is preserved when
105 * skipPaddingArea is requested.
106 * @param testDuration Number of seconds for the test, with range (0, infinity)
107 * @return True, if succeeded
108 */
109 static bool testRandomizedFrameStress(const double testDuration);
110
111 /**
112 * Stress test: copyPixel patch-style overload over random frame
113 * coordinates, validates against a manual byte-wise copy.
114 * @param testDuration Number of seconds for the test, with range (0, infinity)
115 * @return True, if succeeded
116 */
117 static bool testCopyPixelStress(const double testDuration);
118
119 /**
120 * Stress test: createCheckerboardImage with extreme/edge sizes.
121 * @return True, if succeeded
122 */
124};
125
126}
127
128}
129
130}
131
132#endif // META_OCEAN_TEST_TESTCV_TEST_CV_UTILITIES_H
This class implements tests for the CVUtilities class.
Definition TestCVUtilities.h:29
static bool testCheckerboardImage(const double testDuration)
Tests the createCheckerboardImage() function.
static bool testCopyPixel(const double testDuration)
Tests the copyPixel() helpers.
static bool testCopyPixelStress(const double testDuration)
Stress test: copyPixel patch-style overload over random frame coordinates, validates against a manual...
static bool testIsPaddingMemoryIdentical(const double testDuration)
Tests the isPaddingMemoryIdentical() function.
static bool testCheckerboardImageEdge()
Stress test: createCheckerboardImage with extreme/edge sizes.
static bool testRandomizedFrame(const double testDuration)
Tests the randomizeFrame() / randomizedFrame() helpers.
static bool testIsBorderZero(const double testDuration)
Tests the isBorderZero() function.
static bool testRandomizedBinaryMask(const double testDuration)
Tests the randomizedBinaryMask() helper.
static bool testMirrorIndex()
Tests the mirrorIndex() and mirrorOffset() helper functions.
static bool test(const double testDuration, const TestSelector &selector=TestSelector())
Starts all tests of the CVUtilities class.
static bool testMirrorIndexStress(const double testDuration)
Stress test: random indices through the mirrorIndex() function and verifies the index always lands in...
static bool testRandomizedFrameStress(const double testDuration)
Stress test: randomized large frame, randomly randomized many times across all defined data types,...
static bool testDefinedPixelFormats()
Tests the definedPixelFormats() 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