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

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

Issue 225293010: [NaCl SDK] nacl_io: Fix newlib IRT interception of isatty(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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_wrap_newlib.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_wrap_test.cc
diff --git a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
index 89e881daab00904345b9f02434a01cfa65a8311a..c043445af65f11991c629cb957b56d1dd5322364 100644
--- a/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
+++ b/native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc
@@ -296,6 +296,14 @@ TEST_F(KernelWrapTest, ioctl) {
TEST_F(KernelWrapTest, isatty) {
EXPECT_CALL(mock, isatty(kDummyInt)).WillOnce(Return(kDummyInt2));
EXPECT_EQ(kDummyInt2, isatty(kDummyInt));
+
+ // This test verifies that the IRT interception wrapper for isatty
+ // ignores the value of errno when isatty() returns 1. We had a bug
+ // where returning 1 from ki_isatty resulted in errno being returned
+ // by the IRT interface.
+ errno = kDummyInt3;
+ EXPECT_CALL(mock, isatty(kDummyInt)).WillOnce(Return(1));
+ EXPECT_EQ(1, isatty(kDummyInt));
}
#endif
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698