#include "test/testsupport/file_utils.h"
#include <stdio.h>
#include <algorithm>
#include <fstream>
#include <string>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "rtc_base/checks.h"
#include "rtc_base/crypto_random.h"
#include "test/gmock.h"
#include "test/gtest.h"
#ifdef WIN32
#define chdir …
#endif
EndsWith;
namespace webrtc {
namespace test {
namespace {
std::string Path(absl::string_view path) { … }
void CleanDir(absl::string_view dir, size_t* num_deleted_entries) { … }
void WriteStringInFile(absl::string_view what, absl::string_view file_path) { … }
}
class FileUtilsTest : public ::testing::Test { … };
std::string FileUtilsTest::original_working_dir_ = …;
std::string ExpectedRootDirByPlatform() { … }
TEST_F(FileUtilsTest, OutputPathFromUnchangedWorkingDir) { … }
TEST_F(FileUtilsTest, OutputPathFromRootWorkingDir) { … }
TEST_F(FileUtilsTest, RandomOutputPathFromUnchangedWorkingDir) { … }
TEST_F(FileUtilsTest, RandomOutputPathFromRootWorkingDir) { … }
TEST_F(FileUtilsTest, TempFilename) { … }
TEST_F(FileUtilsTest, GenerateTempFilename) { … }
#if defined(WEBRTC_IOS)
#define MAYBE_CreateDir …
#else
#define MAYBE_CreateDir …
#endif
TEST_F(FileUtilsTest, MAYBE_CreateDir) { … }
TEST_F(FileUtilsTest, WorkingDirReturnsValue) { … }
TEST_F(FileUtilsTest, ResourcePathReturnsCorrectPath) { … }
TEST_F(FileUtilsTest, ResourcePathFromRootWorkingDir) { … }
TEST_F(FileUtilsTest, GetFileSizeExistingFile) { … }
TEST_F(FileUtilsTest, GetFileSizeNonExistingFile) { … }
TEST_F(FileUtilsTest, DirExists) { … }
TEST_F(FileUtilsTest, WriteReadDeleteFilesAndDirs) { … }
TEST_F(FileUtilsTest, DirNameStripsFilename) { … }
TEST_F(FileUtilsTest, DirNameKeepsStrippingRightmostPathComponent) { … }
TEST_F(FileUtilsTest, DirNameDoesntCareIfAPathEndsInPathSeparator) { … }
TEST_F(FileUtilsTest, DirNameStopsAtRoot) { … }
TEST_F(FileUtilsTest, JoinFilenameDoesNotAppendExtraPathDelimiterIfExists) { … }
TEST_F(FileUtilsTest, JoinFilenameAppendsPathDelimiterIfMissing) { … }
}
}