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

Unified Diff: native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc

Issue 16122002: [NaCl SDK] MountNodeDir::GetDents sets d_off instead of leaving it undefined. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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/mount_node_dir.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/libraries/nacl_io_test/mount_node_test.cc
diff --git a/native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc b/native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc
index d0072ce3b4f5e1cb0e1dc3183fb9af7146cfc595..2de13cd468431761902237ed8f1a2091a3a7ab2a 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc
+++ b/native_client_sdk/src/libraries/nacl_io_test/mount_node_test.cc
@@ -107,6 +107,7 @@ TEST(MountNodeTest, File) {
struct stat s;
EXPECT_EQ(0, file->GetStat(&s));
+ EXPECT_LT(0, s.st_ino); // 0 is an invalid inode number.
EXPECT_EQ(sizeof(buf1), s.st_size);
// Directory operations should fail
@@ -157,6 +158,9 @@ TEST(MountNodeTest, Directory) {
// Test that the directory is there
struct dirent d;
EXPECT_EQ(sizeof(d), root->GetDents(0, &d, sizeof(d)));
+ EXPECT_LT(0, d.d_ino); // 0 is an invalid inode number.
+ EXPECT_EQ(sizeof(d), d.d_off);
+ EXPECT_EQ(sizeof(d), d.d_reclen);
EXPECT_EQ(0, strcmp("F1", d.d_name));
EXPECT_EQ(0, root->GetDents(sizeof(d), &d, sizeof(d)));
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698