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