Index: native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc |
diff --git a/native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc b/native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc |
index cfa1ca4611f628040e83c6f7d9aa0c3f04980985..7bde1b8242576d0312850b3e539d78dbed56ba9e 100644 |
--- a/native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc |
+++ b/native_client_sdk/src/tests/nacl_io_test/kernel_object_test.cc |
@@ -95,16 +95,18 @@ TEST_F(KernelObjectTest, Referencing) { |
// Allocating an FD should cause the KernelProxy to ref the handle and |
// the node and filesystem should be unchanged. |
- int fd1 = proxy.AllocateFD(handle_a); |
+ int fd1 = proxy.AllocateFD(handle_a, "/example"); |
EXPECT_EQ(3, handle_a->RefCount()); |
EXPECT_EQ(2, fs->RefCount()); |
EXPECT_EQ(2, node->RefCount()); |
+ EXPECT_EQ("/example", proxy.GetFDPath(fd1)); |
// If we "dup" the handle, we should bump the ref count on the handle |
- int fd2 = proxy.AllocateFD(handle_b); |
+ int fd2 = proxy.AllocateFD(handle_b, ""); |
EXPECT_EQ(4, handle_a->RefCount()); |
EXPECT_EQ(2, fs->RefCount()); |
EXPECT_EQ(2, node->RefCount()); |
+ EXPECT_EQ("", proxy.GetFDPath(fd2)); |
// Handles are expected to come out in order |
EXPECT_EQ(0, fd1); |
@@ -165,15 +167,18 @@ TEST_F(KernelObjectTest, FreeAndReassignFD) { |
EXPECT_EQ(2, node->RefCount()); |
EXPECT_EQ(1, raw_handle->RefCount()); |
- proxy.AllocateFD(handle); |
+ int fd1 = proxy.AllocateFD(handle, "/example"); |
EXPECT_EQ(2, fs->RefCount()); |
EXPECT_EQ(2, node->RefCount()); |
EXPECT_EQ(2, raw_handle->RefCount()); |
+ EXPECT_EQ("/example", proxy.GetFDPath(fd1)); |
- proxy.FreeAndReassignFD(5, handle); |
+ proxy.FreeAndReassignFD(5, handle, "/example"); |
EXPECT_EQ(2, fs->RefCount()); |
EXPECT_EQ(2, node->RefCount()); |
EXPECT_EQ(3, raw_handle->RefCount()); |
+ EXPECT_EQ("/example", proxy.GetFDPath(fd1)); |
+ |
handle.reset(); |
EXPECT_EQ(2, raw_handle->RefCount()); |