Ocean
Loading...
Searching...
No Matches
TestFile.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_TEST_FILE_H
9#define META_OCEAN_TEST_TESTIO_TEST_FILE_H
10
12
14
15#include <string>
16#include <utility>
17#include <vector>
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestIO
26{
27
28/**
29 * This class implements tests for the Directory class.
30 * @ingroup testio
31 */
32class OCEAN_TEST_IO_EXPORT TestFile
33{
34 protected:
35
36 /**
37 * Definition of a pair combining a filename with the expected result.
38 */
39 using FilenamePair = std::pair<std::string, std::string>;
40
41 /**
42 * Definition of a vector holding pairs of filenames and expected results.
43 */
44 using FilenamePairs = std::vector<FilenamePair>;
45
46 public:
47
48 /**
49 * Invokes all tests.
50 * @param testDuration The number of seconds for each test
51 * @param selector The test selector
52 * @return True, if succeeded
53 */
54 static bool test(const double testDuration, const TestSelector& selector);
55
56 /**
57 * Tests the exists function.
58 * @param testDuration The number of seconds for each test
59 * @return True, if succeeded
60 */
61 static bool testFileExists(const double testDuration);
62
63 /**
64 * Tests the name function.
65 * @return True, if succeeded
66 */
67 static bool testName();
68
69 /**
70 * Tests the base function.
71 * @return True, if succeeded
72 */
73 static bool testBase();
74
75 /**
76 * Tests the base name function.
77 * @return True, if succeeded
78 */
79 static bool testBaseName();
80
81 /**
82 * Tests the extension function.
83 * @return True, if succeeded
84 */
85 static bool testExtension();
86};
87
88}
89
90}
91
92}
93
94#endif // META_OCEAN_TEST_TESTIO_TEST_FILE_H
This class implements tests for the Directory class.
Definition TestFile.h:33
std::pair< std::string, std::string > FilenamePair
Definition of a pair combining a filename with the expected result.
Definition TestFile.h:39
static bool testExtension()
Tests the extension function.
std::vector< FilenamePair > FilenamePairs
Definition of a vector holding pairs of filenames and expected results.
Definition TestFile.h:44
static bool testFileExists(const double testDuration)
Tests the exists function.
static bool testBaseName()
Tests the base name function.
static bool testBase()
Tests the base function.
static bool test(const double testDuration, const TestSelector &selector)
Invokes all tests.
static bool testName()
Tests the name 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