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

Side by Side Diff: runtime/bin/directory_test.cc

Issue 2480793002: clang-format runtime/bin (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/directory_macos.cc ('k') | runtime/bin/directory_unsupported.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/directory.h" 5 #include "bin/directory.h"
6 #include "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/thread.h" 9 #include "vm/thread.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EXPECT(dart::bin::Directory::Create(name)); 124 EXPECT(dart::bin::Directory::Create(name));
125 125
126 // Make sure it exists. 126 // Make sure it exists.
127 dart::bin::Directory::ExistsResult r = dart::bin::Directory::Exists(name); 127 dart::bin::Directory::ExistsResult r = dart::bin::Directory::Exists(name);
128 EXPECT_EQ(dart::bin::Directory::EXISTS, r); 128 EXPECT_EQ(dart::bin::Directory::EXISTS, r);
129 129
130 const intptr_t new_name_len = 130 const intptr_t new_name_len =
131 snprintf(NULL, 0, "%s/%snewname", system_temp, kTempDirName); 131 snprintf(NULL, 0, "%s/%snewname", system_temp, kTempDirName);
132 ASSERT(new_name_len > 0); 132 ASSERT(new_name_len > 0);
133 char* new_name = new char[new_name_len + 1]; 133 char* new_name = new char[new_name_len + 1];
134 snprintf(new_name, new_name_len + 1, "%s/%snewname", 134 snprintf(new_name, new_name_len + 1, "%s/%snewname", system_temp,
135 system_temp, kTempDirName); 135 kTempDirName);
136 136
137 EXPECT(dart::bin::Directory::Rename(name, new_name)); 137 EXPECT(dart::bin::Directory::Rename(name, new_name));
138 138
139 r = dart::bin::Directory::Exists(new_name); 139 r = dart::bin::Directory::Exists(new_name);
140 EXPECT_EQ(dart::bin::Directory::EXISTS, r); 140 EXPECT_EQ(dart::bin::Directory::EXISTS, r);
141 141
142 r = dart::bin::Directory::Exists(name); 142 r = dart::bin::Directory::Exists(name);
143 EXPECT_EQ(dart::bin::Directory::DOES_NOT_EXIST, r); 143 EXPECT_EQ(dart::bin::Directory::DOES_NOT_EXIST, r);
144 144
145 EXPECT(dart::bin::Directory::Delete(new_name, false)); 145 EXPECT(dart::bin::Directory::Delete(new_name, false));
146 delete[] name; 146 delete[] name;
147 delete[] new_name; 147 delete[] new_name;
148 } 148 }
149 149
150 } // namespace dart 150 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/directory_macos.cc ('k') | runtime/bin/directory_unsupported.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698