Ocean
Loading...
Searching...
No Matches
TestBullseye.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
15
16namespace Ocean
17{
18
19namespace Test
20{
21
22namespace TestCV
23{
24
25namespace TestDetector
26{
27
28namespace TestBullseyes
29{
30
31/**
32 * This class implements tests for the Bullseye class
33 * @ingroup testcvdetectorbullseyes
34 */
35class OCEAN_TEST_CV_DETECTOR_BULLSEYES_EXPORT TestBullseye
36{
37 protected:
38
39 /// Alias for the Bullseye class.
41
42 public:
43
44 /**
45 * Tests the Bullseye functions.
46 * @param testDuration Number of seconds for each test, with range (0, infinity)
47 * @return True, if succeeded
48 */
49 static bool test(const double testDuration);
50
51 /**
52 * Test for Bullseye::isValid()
53 * @param testDuration The duration in seconds for which this test will be run, must be > 0.0
54 * @param randomGenerator A random generator that will be used to generate test data
55 * @return True, if succeeded
56 */
57 static bool testBullseyeIsValid(const double testDuration, RandomGenerator& randomGenerator);
58
59 /**
60 * Test for Bullseye constructor
61 * @param testDuration The duration in seconds for which this test will be run, must be > 0.0
62 * @param randomGenerator A random generator that will be used to generate test data
63 * @return True, if succeeded
64 */
65 static bool testBullseyeConstructor(const double testDuration, RandomGenerator& randomGenerator);
66
67 /**
68 * Test for Bullseye::position()
69 * @param testDuration The duration in seconds for which this test will be run, must be > 0.0
70 * @param randomGenerator A random generator that will be used to generate test data
71 * @return True, if succeeded
72 */
73 static bool testBullseyePosition(const double testDuration, RandomGenerator& randomGenerator);
74
75 /**
76 * Test for Bullseye::radius()
77 * @param testDuration The duration in seconds for which this test will be run, must be > 0.0
78 * @param randomGenerator A random generator that will be used to generate test data
79 * @return True, if succeeded
80 */
81 static bool testBullseyeRadius(const double testDuration, RandomGenerator& randomGenerator);
82
83 /**
84 * Test for Bullseye::grayThreshold()
85 * @param testDuration The duration in seconds for which this test will be run, must be > 0.0
86 * @param randomGenerator A random generator that will be used to generate test data
87 * @return True, if succeeded
88 */
89 static bool testBullseyeGrayThreshold(const double testDuration, RandomGenerator& randomGenerator);
90
91 protected:
92
93 /**
94 * Creates a random valid bullseye with random position, radius, and gray threshold
95 * @param randomGenerator A random generator that will be used to generate test data
96 * @return A valid bullseye with random parameters
97 */
99};
100
101} // namespace TestBullseyes
102
103} // namespace TestDetector
104
105} // namespace TestCV
106
107} // namespace Test
108
109} // namespace Ocean
Definition of a bullseye composed of a location and a radius.
Definition Bullseye.h:32
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements tests for the Bullseye class.
Definition TestBullseye.h:36
static bool testBullseyePosition(const double testDuration, RandomGenerator &randomGenerator)
Test for Bullseye::position()
static bool testBullseyeRadius(const double testDuration, RandomGenerator &randomGenerator)
Test for Bullseye::radius()
static bool testBullseyeGrayThreshold(const double testDuration, RandomGenerator &randomGenerator)
Test for Bullseye::grayThreshold()
static bool test(const double testDuration)
Tests the Bullseye functions.
static bool testBullseyeIsValid(const double testDuration, RandomGenerator &randomGenerator)
Test for Bullseye::isValid()
static Bullseye createRandomValidBullseye(RandomGenerator &randomGenerator)
Creates a random valid bullseye with random position, radius, and gray threshold.
static bool testBullseyeConstructor(const double testDuration, RandomGenerator &randomGenerator)
Test for Bullseye constructor.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15