OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 EXPECT_EQ(strlen(contents), size); | 404 EXPECT_EQ(strlen(contents), size); |
405 EXPECT_FALSE(node->IsaDir()); | 405 EXPECT_FALSE(node->IsaDir()); |
406 EXPECT_TRUE(node->IsaFile()); | 406 EXPECT_TRUE(node->IsaFile()); |
407 EXPECT_EQ(ENOTTY, node->Isatty()); | 407 EXPECT_EQ(ENOTTY, node->Isatty()); |
408 | 408 |
409 // GetStat on a directory... | 409 // GetStat on a directory... |
410 EXPECT_EQ(0, fs->Open(Path("/dir"), O_RDONLY, &node)); | 410 EXPECT_EQ(0, fs->Open(Path("/dir"), O_RDONLY, &node)); |
411 EXPECT_EQ(0, node->GetStat(&statbuf)); | 411 EXPECT_EQ(0, node->GetStat(&statbuf)); |
412 EXPECT_TRUE(S_ISDIR(statbuf.st_mode)); | 412 EXPECT_TRUE(S_ISDIR(statbuf.st_mode)); |
413 EXPECT_EQ(S_IRALL | S_IWALL | S_IXALL, statbuf.st_mode & S_MODEBITS); | 413 EXPECT_EQ(S_IRALL | S_IWALL | S_IXALL, statbuf.st_mode & S_MODEBITS); |
414 EXPECT_EQ(0, statbuf.st_size); | 414 EXPECT_EQ(4096, statbuf.st_size); |
415 EXPECT_EQ(access_time, statbuf.st_atime); | 415 EXPECT_EQ(access_time, statbuf.st_atime); |
416 EXPECT_EQ(creation_time, statbuf.st_ctime); | 416 EXPECT_EQ(creation_time, statbuf.st_ctime); |
417 EXPECT_EQ(modified_time, statbuf.st_mtime); | 417 EXPECT_EQ(modified_time, statbuf.st_mtime); |
418 | 418 |
419 // Test Get* and Isa* methods. | 419 // Test Get* and Isa* methods. |
420 EXPECT_EQ(0, node->GetSize(&size)); | 420 EXPECT_EQ(0, node->GetSize(&size)); |
421 EXPECT_EQ(0, size); | 421 EXPECT_EQ(0, size); |
422 EXPECT_TRUE(node->IsaDir()); | 422 EXPECT_TRUE(node->IsaDir()); |
423 EXPECT_FALSE(node->IsaFile()); | 423 EXPECT_FALSE(node->IsaFile()); |
424 EXPECT_EQ(ENOTTY, node->Isatty()); | 424 EXPECT_EQ(ENOTTY, node->Isatty()); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 EXPECT_EQ(dirents[i].d_ino, file2_ino); | 547 EXPECT_EQ(dirents[i].d_ino, file2_ino); |
548 } | 548 } |
549 } | 549 } |
550 | 550 |
551 EXPECT_EQ(1, dirnames.count("file")); | 551 EXPECT_EQ(1, dirnames.count("file")); |
552 EXPECT_EQ(1, dirnames.count("file2")); | 552 EXPECT_EQ(1, dirnames.count("file2")); |
553 EXPECT_EQ(1, dirnames.count(".")); | 553 EXPECT_EQ(1, dirnames.count(".")); |
554 EXPECT_EQ(1, dirnames.count("..")); | 554 EXPECT_EQ(1, dirnames.count("..")); |
555 } | 555 } |
556 } | 556 } |
OLD | NEW |