Ocean
Loading...
Searching...
No Matches
TestMedia.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_TESTMEDIA_TEST_MEDIA_H
9#define META_OCEAN_TEST_TESTMEDIA_TEST_MEDIA_H
10
11#include "ocean/test/Test.h"
12
13#include "ocean/base/Worker.h"
14
15#include "ocean/media/Media.h"
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestMedia
24{
25
26/**
27 * @ingroup test
28 * @defgroup testmedia Ocean Test Media Library
29 * @{
30 * The Ocean Test Media Library implemenets/provides several tests for Ocean's individual media libraries.
31 * The library is platform independent (by invoking only those tests that are available on each individual platform).
32 * @}
33 */
34
35/**
36 * @namespace Ocean::Test::TestMedia Namespace of the Media Test library.<p>
37 * The Namespace Ocean::Test::TestMedia is used in the entire Ocean Media Test Library.
38 */
39
40// Defines OCEAN_TEST_MEDIA_EXPORT for dll export and import.
41#if defined(_WINDOWS) && defined(OCEAN_RUNTIME_SHARED)
42 #ifdef USE_OCEAN_TEST_MEDIA_EXPORT
43 #define OCEAN_TEST_MEDIA_EXPORT __declspec(dllexport)
44 #else
45 #define OCEAN_TEST_MEDIA_EXPORT __declspec(dllimport)
46 #endif
47#else
48 #define OCEAN_TEST_MEDIA_EXPORT
49#endif
50
51/**
52 * Tests all Media libraries.
53 * @param testDuration Number of seconds for each test, with range (0, infinity)
54 * @param worker The worker object to distribute some computation on as many CPU cores as defined in the worker object
55 * @param testFunctions Optional name of the functions to be tested
56 * @return True, if the entire test succeeded
57 * @ingroup testmedia
58 */
59OCEAN_TEST_MEDIA_EXPORT bool testMedia(const double testDuration, Worker& worker, const std::string& testFunctions = std::string());
60
61/**
62 * Tests all Media libraries.
63 * This function returns directly as the actual test is invoked in an own thread.<br>
64 * Use this function in intended for non-console applications like e.g., mobile devices.
65 * @param testDuration Number of seconds for each test, with range (0, infinity)
66 * @param testFunctions Optional name of the functions to be tested
67 * @ingroup testmedia
68 */
69OCEAN_TEST_MEDIA_EXPORT void testMediaAsynchron(const double testDuration, const std::string& testFunctions = std::string());
70}
71
72}
73
74}
75
76#endif // META_OCEAN_TEST_TESTMEDIA_TEST_MEDIA_H
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
OCEAN_TEST_MEDIA_EXPORT bool testMedia(const double testDuration, Worker &worker, const std::string &testFunctions=std::string())
Tests all Media libraries.
OCEAN_TEST_MEDIA_EXPORT void testMediaAsynchron(const double testDuration, const std::string &testFunctions=std::string())
Tests all Media libraries.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15