OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file.h" | 6 #include "base/files/file.h" |
7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 FILE* f = fopen(new_file_dir.AsUTF8Unsafe().c_str(), "w"); | 239 FILE* f = fopen(new_file_dir.AsUTF8Unsafe().c_str(), "w"); |
240 if (f) { | 240 if (f) { |
241 fputs("Temp file contents", f); | 241 fputs("Temp file contents", f); |
242 fclose(f); | 242 fclose(f); |
243 } | 243 } |
244 | 244 |
245 Env* env = IDBEnv(); | 245 Env* env = IDBEnv(); |
246 std::vector<std::string> result; | 246 std::vector<std::string> result; |
247 leveldb::Status status = env->GetChildren(dir.AsUTF8Unsafe(), &result); | 247 leveldb::Status status = env->GetChildren(dir.AsUTF8Unsafe(), &result); |
248 EXPECT_TRUE(status.ok()); | 248 EXPECT_TRUE(status.ok()); |
249 EXPECT_EQ(1, result.size()); | 249 EXPECT_EQ(1U, result.size()); |
250 | 250 |
251 // And a second time should also return one result | 251 // And a second time should also return one result |
252 status = env->GetChildren(dir.AsUTF8Unsafe(), &result); | 252 status = env->GetChildren(dir.AsUTF8Unsafe(), &result); |
253 EXPECT_TRUE(status.ok()); | 253 EXPECT_TRUE(status.ok()); |
254 EXPECT_EQ(1, result.size()); | 254 EXPECT_EQ(1U, result.size()); |
255 } | 255 } |
256 | 256 |
257 int main(int argc, char** argv) { return base::TestSuite(argc, argv).Run(); } | 257 int main(int argc, char** argv) { return base::TestSuite(argc, argv).Run(); } |
OLD | NEW |