Ocean
Loading...
Searching...
No Matches
TestMediaSerializer.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_TESTIO_TESTSERIALIZATION_TEST_MEDIA_SERIALIZER_H
9#define META_OCEAN_TEST_TESTIO_TESTSERIALIZATION_TEST_MEDIA_SERIALIZER_H
10
12
14
16
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestIO
26{
27
28namespace TestSerialization
29{
30
31/**
32 * This class implements a test for the MediaSerializer class.
33 * @ingroup testioserialization
34 */
35class OCEAN_TEST_IO_SERIALIZATION_EXPORT TestMediaSerializer
36{
37 public:
38
39 /**
40 * Tests all functions of the MediaSerializer class.
41 * @param testDuration The number of seconds for each test
42 * @param selector The test selector
43 * @return True, if succeeded
44 */
45 static bool test(const double testDuration, const TestSelector& selector);
46
47 /**
48 * Tests the SampleFrame constructor with frame encoding.
49 * @param testDuration The number of seconds for each test
50 * @return True, if succeeded
51 */
52 static bool testSampleFrameConstructor(const double testDuration);
53
54 /**
55 * Tests the SampleFrame read/write functions.
56 * @param testDuration The number of seconds for each test
57 * @return True, if succeeded
58 */
59 static bool testSampleFrameReadWrite(const double testDuration);
60
61 /**
62 * Tests the SampleFrame with custom encoded buffer.
63 * @param testDuration The number of seconds for each test
64 * @return True, if succeeded
65 */
66 static bool testSampleFrameCustomBuffer(const double testDuration);
67
68 /**
69 * Tests the SampleFrame with camera model.
70 * @param testDuration The number of seconds for each test
71 * @return True, if succeeded
72 */
73 static bool testSampleFrameWithCamera(const double testDuration);
74
75 protected:
76
77 /**
78 * Returns a random frame.
79 * @param randomGenerator The random generator to be used
80 * @return The random frame
81 */
82 static Frame randomFrame(RandomGenerator& randomGenerator);
83
84 /**
85 * Checks whether two frames are equal.
86 * @param frameA The first frame to check
87 * @param frameB The second frame to check
88 * @return True, if so
89 */
90 static bool isFrameContentEqual(const Frame& frameA, const Frame& frameB);
91};
92
93}
94
95}
96
97}
98
99}
100
101#endif // META_OCEAN_TEST_TESTIO_TESTSERIALIZATION_TEST_MEDIA_SERIALIZER_H
This class implements Ocean's image class.
Definition Frame.h:1879
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements a test for the MediaSerializer class.
Definition TestMediaSerializer.h:36
static bool testSampleFrameCustomBuffer(const double testDuration)
Tests the SampleFrame with custom encoded buffer.
static bool test(const double testDuration, const TestSelector &selector)
Tests all functions of the MediaSerializer class.
static bool testSampleFrameWithCamera(const double testDuration)
Tests the SampleFrame with camera model.
static Frame randomFrame(RandomGenerator &randomGenerator)
Returns a random frame.
static bool testSampleFrameReadWrite(const double testDuration)
Tests the SampleFrame read/write functions.
static bool testSampleFrameConstructor(const double testDuration)
Tests the SampleFrame constructor with frame encoding.
static bool isFrameContentEqual(const Frame &frameA, const Frame &frameB)
Checks whether two frames are equal.
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