Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1315)

Unified Diff: runtime/bin/directory_test.cc

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/directory_patch.dart ('k') | runtime/bin/directory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_test.cc
diff --git a/runtime/bin/directory_test.cc b/runtime/bin/directory_test.cc
index 40a91f0eca0fa81ebadbf3ab3e1fd40ab4139df8..4a11eef269a7663ad421784f2e265e4b37c13dc0 100644
--- a/runtime/bin/directory_test.cc
+++ b/runtime/bin/directory_test.cc
@@ -18,68 +18,69 @@ VM_UNIT_TEST_CASE(DirectoryCurrentNoScope) {
}
TEST_CASE(DirectoryCurrent) {
- const char* current = dart::bin::Directory::Current();
+ const char* current = dart::bin::Directory::Current(NULL);
EXPECT_NOTNULL(current);
}
TEST_CASE(DirectoryExists) {
- const char* current = dart::bin::Directory::Current();
+ const char* current = dart::bin::Directory::Current(NULL);
EXPECT_NOTNULL(current);
- dart::bin::Directory::ExistsResult r = dart::bin::Directory::Exists(current);
+ dart::bin::Directory::ExistsResult r =
+ dart::bin::Directory::Exists(NULL, current);
EXPECT_EQ(dart::bin::Directory::EXISTS, r);
}
TEST_CASE(DirectorySystemTemp) {
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
}
TEST_CASE(DirectorySystemTempExists) {
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
dart::bin::Directory::ExistsResult r =
- dart::bin::Directory::Exists(system_temp);
+ dart::bin::Directory::Exists(NULL, system_temp);
EXPECT_EQ(dart::bin::Directory::EXISTS, r);
}
TEST_CASE(DirectoryCreateTemp) {
const char* kTempPrefix = "test_prefix";
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
- const char* temp_dir = dart::bin::Directory::CreateTemp(kTempPrefix);
+ const char* temp_dir = dart::bin::Directory::CreateTemp(NULL, kTempPrefix);
EXPECT_NOTNULL(temp_dir);
// Make sure temp_dir contains test_prefix.
EXPECT_NOTNULL(strstr(temp_dir, kTempPrefix));
// Cleanup.
- EXPECT(dart::bin::Directory::Delete(temp_dir, false));
+ EXPECT(dart::bin::Directory::Delete(NULL, temp_dir, false));
}
TEST_CASE(DirectorySetCurrent) {
- const char* current = dart::bin::Directory::Current();
+ const char* current = dart::bin::Directory::Current(NULL);
EXPECT_NOTNULL(current);
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
- EXPECT(dart::bin::Directory::SetCurrent(system_temp));
+ EXPECT(dart::bin::Directory::SetCurrent(NULL, system_temp));
- const char* new_current = dart::bin::Directory::Current();
+ const char* new_current = dart::bin::Directory::Current(NULL);
EXPECT_NOTNULL(new_current);
EXPECT_NOTNULL(strstr(new_current, system_temp));
- EXPECT(dart::bin::Directory::SetCurrent(current));
+ EXPECT(dart::bin::Directory::SetCurrent(NULL, current));
}
TEST_CASE(DirectoryCreateDelete) {
const char* kTempDirName = "create_delete_test_name";
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
const intptr_t name_len =
@@ -89,21 +90,22 @@ TEST_CASE(DirectoryCreateDelete) {
snprintf(name, name_len + 1, "%s/%s", system_temp, kTempDirName);
// Make a directory.
- EXPECT(dart::bin::Directory::Create(name));
+ EXPECT(dart::bin::Directory::Create(NULL, name));
// Make sure it exists.
- dart::bin::Directory::ExistsResult r = dart::bin::Directory::Exists(name);
+ dart::bin::Directory::ExistsResult r =
+ dart::bin::Directory::Exists(NULL, name);
EXPECT_EQ(dart::bin::Directory::EXISTS, r);
// Cleanup.
- EXPECT(dart::bin::Directory::Delete(name, false));
+ EXPECT(dart::bin::Directory::Delete(NULL, name, false));
delete[] name;
}
TEST_CASE(DirectoryRename) {
const char* kTempDirName = "rename_test_name";
- const char* system_temp = dart::bin::Directory::SystemTemp();
+ const char* system_temp = dart::bin::Directory::SystemTemp(NULL);
EXPECT_NOTNULL(system_temp);
const intptr_t name_len =
@@ -113,10 +115,11 @@ TEST_CASE(DirectoryRename) {
snprintf(name, name_len + 1, "%s/%s", system_temp, kTempDirName);
// Make a directory.
- EXPECT(dart::bin::Directory::Create(name));
+ EXPECT(dart::bin::Directory::Create(NULL, name));
// Make sure it exists.
- dart::bin::Directory::ExistsResult r = dart::bin::Directory::Exists(name);
+ dart::bin::Directory::ExistsResult r =
+ dart::bin::Directory::Exists(NULL, name);
EXPECT_EQ(dart::bin::Directory::EXISTS, r);
const intptr_t new_name_len =
@@ -126,15 +129,15 @@ TEST_CASE(DirectoryRename) {
snprintf(new_name, new_name_len + 1, "%s/%snewname", system_temp,
kTempDirName);
- EXPECT(dart::bin::Directory::Rename(name, new_name));
+ EXPECT(dart::bin::Directory::Rename(NULL, name, new_name));
- r = dart::bin::Directory::Exists(new_name);
+ r = dart::bin::Directory::Exists(NULL, new_name);
EXPECT_EQ(dart::bin::Directory::EXISTS, r);
- r = dart::bin::Directory::Exists(name);
+ r = dart::bin::Directory::Exists(NULL, name);
EXPECT_EQ(dart::bin::Directory::DOES_NOT_EXIST, r);
- EXPECT(dart::bin::Directory::Delete(new_name, false));
+ EXPECT(dart::bin::Directory::Delete(NULL, new_name, false));
delete[] name;
delete[] new_name;
}
« no previous file with comments | « runtime/bin/directory_patch.dart ('k') | runtime/bin/directory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698