Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
tonic
filesystem
tests
directory_unittest.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "filesystem/directory.h"
6
#include "
filesystem/path.h
"
7
#include "filesystem/scoped_temp_dir.h"
8
#include "gtest/gtest.h"
9
10
namespace
filesystem
{
11
12
TEST
(Directory,
CreateDirectory
) {
13
std::string cwd =
GetCurrentDirectory
();
14
15
ScopedTempDir dir;
16
EXPECT_TRUE
(IsDirectory(dir.
path
()));
17
EXPECT_EQ(0, chdir(dir.
path
().c_str()));
18
19
EXPECT_TRUE
(
CreateDirectory
(
"foo/bar"
));
20
EXPECT_TRUE
(IsDirectory(
"foo"
));
21
EXPECT_TRUE
(IsDirectory(
"foo/bar"
));
22
EXPECT_FALSE(IsDirectory(
"foo/bar/baz"
));
23
24
EXPECT_TRUE
(
CreateDirectory
(
"foo/bar/baz"
));
25
EXPECT_TRUE
(IsDirectory(
"foo/bar/baz"
));
26
27
EXPECT_TRUE
(
CreateDirectory
(
"qux"
));
28
EXPECT_TRUE
(IsDirectory(
"qux"
));
29
30
EXPECT_EQ(0, chdir(cwd.c_str()));
31
32
std::string abs_path = dir.
path
() +
"/another/one"
;
33
EXPECT_TRUE
(
CreateDirectory
(abs_path));
34
EXPECT_TRUE
(IsDirectory(abs_path));
35
}
36
37
}
// namespace filesystem
TEST
#define TEST(S, s, D, expected)
Definition
FitsInTest.cpp:15
flutter::CanvasPath::path
const SkPath & path() const
Definition
path.h:117
filesystem
Definition
file.cc:29
path.h
EXPECT_TRUE
#define EXPECT_TRUE(handle)
Definition
unit_test.h:685
CreateDirectory
#define CreateDirectory
Definition
windows_types.h:249
GetCurrentDirectory
#define GetCurrentDirectory
Definition
windows_types.h:259
Generated on Fri Apr 26 2024 06:18:17 for Flutter Engine by
1.9.8