OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 #include "../base/KernelProxy.h" | 6 #include "base/KernelProxy.h" |
7 #include "gtest/gtest.h" | 7 #include "gtest/gtest.h" |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 | 11 |
12 | 12 |
13 TEST(SimpleTest, Simple) { | 13 TEST(SimpleTest, Simple) { |
14 struct stat buf; | 14 struct stat buf; |
15 EXPECT_EQ(0, stat("/", &buf)); | 15 EXPECT_EQ(0, stat("/", &buf)); |
16 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); | 16 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); |
17 EXPECT_EQ(0, stat("/dev", &buf)); | 17 EXPECT_EQ(0, stat("/dev", &buf)); |
18 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); | 18 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); |
19 EXPECT_EQ(0, stat("/dev/fd", &buf)); | 19 EXPECT_EQ(0, stat("/dev/fd", &buf)); |
20 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); | 20 EXPECT_EQ(1, S_ISDIR(buf.st_mode)); |
21 | 21 |
22 EXPECT_EQ(-1, stat("/dummy", &buf)); | 22 EXPECT_EQ(-1, stat("/dummy", &buf)); |
23 } | 23 } |
OLD | NEW |