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

Unified Diff: native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc

Issue 125693002: Implement lstat by stat in nacl_io (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc
diff --git a/native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc b/native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc
index 44c158d65e41dcb85e4e22cd800eb5a7f51245df..08e690ed1c9a531e451792237a6a38c91e3387a9 100644
--- a/native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc
+++ b/native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc
@@ -416,6 +416,24 @@ TEST_F(KernelProxyTest, MemMountDup) {
// fd, new_fd, dup_fd -> "/bar"
}
+TEST_F(KernelProxyTest, Lstat) {
+ int fd = ki_open("/foo", O_CREAT | O_RDWR);
+ ASSERT_GT(fd, -1);
+ ASSERT_EQ(0, ki_mkdir("/bar", S_IREAD | S_IWRITE));
+
+ struct stat buf;
+ EXPECT_EQ(0, ki_lstat("/foo", &buf));
+ EXPECT_EQ(0, buf.st_size);
+ EXPECT_TRUE(S_ISREG(buf.st_mode));
+
+ EXPECT_EQ(0, ki_lstat("/bar", &buf));
+ EXPECT_EQ(0, buf.st_size);
+ EXPECT_TRUE(S_ISDIR(buf.st_mode));
+
+ EXPECT_EQ(-1, ki_lstat("/no-such-file", &buf));
+ EXPECT_EQ(ENOENT, errno);
+}
+
namespace {
StringMap_t g_string_map;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698