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

Side by Side Diff: base/dir_reader_posix_unittest.cc

Issue 7275004: base: Use TEST() macro in Value unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_descriptor_shuffle_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dir_reader_posix.h" 5 #include "base/dir_reader_posix.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 12
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 using base::DirReaderPosix; 16 namespace base {
17
18 namespace {
19 typedef testing::Test DirReaderPosixUnittest;
20 17
21 TEST(DirReaderPosixUnittest, Read) { 18 TEST(DirReaderPosixUnittest, Read) {
22 static const unsigned kNumFiles = 100; 19 static const unsigned kNumFiles = 100;
23 20
24 if (DirReaderPosix::IsFallback()) 21 if (DirReaderPosix::IsFallback())
25 return; 22 return;
26 23
27 char kDirTemplate[] = "/tmp/org.chromium.dir-reader-posix-XXXXXX"; 24 char kDirTemplate[] = "/tmp/org.chromium.dir-reader-posix-XXXXXX";
28 const char* dir = mkdtemp(kDirTemplate); 25 const char* dir = mkdtemp(kDirTemplate);
29 CHECK(dir); 26 CHECK(dir);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 PCHECK(rmdir(dir) == 0); 78 PCHECK(rmdir(dir) == 0);
82 79
83 PCHECK(fchdir(prev_wd) == 0); 80 PCHECK(fchdir(prev_wd) == 0);
84 PCHECK(close(prev_wd) == 0); 81 PCHECK(close(prev_wd) == 0);
85 82
86 EXPECT_TRUE(seen_dot); 83 EXPECT_TRUE(seen_dot);
87 EXPECT_TRUE(seen_dotdot); 84 EXPECT_TRUE(seen_dotdot);
88 EXPECT_EQ(kNumFiles, seen.size()); 85 EXPECT_EQ(kNumFiles, seen.size());
89 } 86 }
90 87
91 } // anonymous namespace 88 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/file_descriptor_shuffle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698