summaryrefslogtreecommitdiffstats
path: root/util/folder/fts_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/folder/fts_ut.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/folder/fts_ut.cpp')
-rw-r--r--util/folder/fts_ut.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/util/folder/fts_ut.cpp b/util/folder/fts_ut.cpp
index 35c6d688636..c5d59e35f42 100644
--- a/util/folder/fts_ut.cpp
+++ b/util/folder/fts_ut.cpp
@@ -1,61 +1,61 @@
-#include "fts.h"
-#include "dirut.h"
+#include "fts.h"
+#include "dirut.h"
#include "tempdir.h"
-
+
#include <library/cpp/testing/unittest/registar.h>
#include <library/cpp/threading/future/async.h>
-#include <util/system/file.h>
+#include <util/system/file.h>
#include <util/system/tempfile.h>
#include <util/generic/string.h>
class TFtsTest: public TTestBase {
- UNIT_TEST_SUITE(TFtsTest);
- UNIT_TEST(TestSimple);
+ UNIT_TEST_SUITE(TFtsTest);
+ UNIT_TEST(TestSimple);
UNIT_TEST(TestNoLeakChangingAccessToFolder);
- UNIT_TEST_SUITE_END();
+ UNIT_TEST_SUITE_END();
-public:
- void TestSimple();
+public:
+ void TestSimple();
void TestNoLeakChangingAccessToFolder();
};
-void MakeFile(const char* path) {
- TFile(path, CreateAlways);
+void MakeFile(const char* path) {
+ TFile(path, CreateAlways);
}
//There potentially could be problems in listing order on different platforms
-int FtsCmp(const FTSENT** ent1, const FTSENT** ent2) {
+int FtsCmp(const FTSENT** ent1, const FTSENT** ent2) {
return strcmp((*ent1)->fts_accpath, (*ent2)->fts_accpath);
}
-void CheckEnt(FTSENT* ent, const char* name, int type) {
+void CheckEnt(FTSENT* ent, const char* name, int type) {
UNIT_ASSERT(ent);
UNIT_ASSERT_STRINGS_EQUAL(ent->fts_path, name);
UNIT_ASSERT_EQUAL(ent->fts_info, type);
}
-class TFileTree {
+class TFileTree {
public:
- TFileTree(char* const* argv, int options, int (*compar)(const FTSENT**, const FTSENT**)) {
- Fts_ = yfts_open(argv, options, compar);
+ TFileTree(char* const* argv, int options, int (*compar)(const FTSENT**, const FTSENT**)) {
+ Fts_ = yfts_open(argv, options, compar);
}
- ~TFileTree() {
- yfts_close(Fts_);
+ ~TFileTree() {
+ yfts_close(Fts_);
}
FTS* operator()() {
- return Fts_;
+ return Fts_;
}
-
+
private:
- FTS* Fts_;
+ FTS* Fts_;
};
-void TFtsTest::TestSimple() {
+void TFtsTest::TestSimple() {
const char* dotPath[2] = {"." LOCSLASH_S, nullptr};
- TFileTree currentDirTree((char* const*)dotPath, 0, FtsCmp);
+ TFileTree currentDirTree((char* const*)dotPath, 0, FtsCmp);
UNIT_ASSERT(currentDirTree());
TTempDir tempDir = MakeTempName(yfts_read(currentDirTree())->fts_path);
MakeDirIfNotExist(tempDir().data());
@@ -67,7 +67,7 @@ void TFtsTest::TestSimple() {
MakeFile((tempDir() + LOCSLASH_S "dir2" LOCSLASH_S "file4").data());
const char* path[2] = {tempDir().data(), nullptr};
- TFileTree fileTree((char* const*)path, 0, FtsCmp);
+ TFileTree fileTree((char* const*)path, 0, FtsCmp);
UNIT_ASSERT(fileTree());
CheckEnt(yfts_read(fileTree()), tempDir().data(), FTS_D);
CheckEnt(yfts_read(fileTree()), (tempDir() + LOCSLASH_S "dir1").data(), FTS_D);
@@ -120,4 +120,4 @@ void TFtsTest::TestNoLeakChangingAccessToFolder() {
chmodFuture.Wait();
}
-UNIT_TEST_SUITE_REGISTRATION(TFtsTest);
+UNIT_TEST_SUITE_REGISTRATION(TFtsTest);