Ocean
Loading...
Searching...
No Matches
TestDirectory.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_DIRECTORY_H
9#define META_OCEAN_TEST_TESTIO_TEST_DIRECTORY_H
10
12
13#include "ocean/io/Directory.h"
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestIO
24{
25
26/**
27 * This class implements tests for the Directory class.
28 * @ingroup testio
29 */
30class OCEAN_TEST_IO_EXPORT TestDirectory
31{
32 public:
33
34 /**
35 * Invokes all tests.
36 * @param testDuration The number of seconds for each test
37 * @param selector The test selector
38 * @return True, if succeeded
39 */
40 static bool test(const double testDuration, const TestSelector& selector);
41
42 /**
43 * Tests the ScopedDirectory object.
44 * @param testDuration The number of seconds for each test
45 * @return True, if succeeded
46 */
47 static bool testScopedDirectory(const double testDuration);
48
49 protected:
50
51 /**
52 * Creates random files and random sub-directories in a given directory.
53 * @param directory The directory in which the content will be created
54 * @param numberFiles The number of files to create
55 * @param numberDirectories The number of sub-directories to create
56 * @return True, if succeeded
57 */
58 static bool createContentInDirectory(const IO::Directory& directory, const unsigned int numberFiles, const unsigned int numberDirectories);
59};
60
61}
62
63}
64
65}
66
67#endif // META_OCEAN_TEST_TESTIO_TEST_DIRECTORY_H
This class holds a directory.
Definition Directory.h:36
This class implements tests for the Directory class.
Definition TestDirectory.h:31
static bool test(const double testDuration, const TestSelector &selector)
Invokes all tests.
static bool createContentInDirectory(const IO::Directory &directory, const unsigned int numberFiles, const unsigned int numberDirectories)
Creates random files and random sub-directories in a given directory.
static bool testScopedDirectory(const double testDuration)
Tests the ScopedDirectory object.
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