diff options
author | Elliott Hughes <enh@google.com> | 2013-02-11 16:36:48 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-02-11 16:39:10 -0800 |
commit | 5e3fc43ddeada547a155c6f561a12ff0b16e02d3 (patch) | |
tree | 9becf3a8442387f408f7f9ee73ab06ab7f8865d1 /tests/stdio_test.cpp | |
parent | 1fea0f258a45d918fe5ae8e9769f45c0348bd095 (diff) |
Fix __pthread_clone on ARM to set errno on failure.
MIPS and x86 appear to have been correct already.
(Also fix unit tests that ASSERT_EQ with errno so that the
arguments are in the retarded junit order.)
Bug: 3461078
Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r-- | tests/stdio_test.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 39f9b0f3d..70a71fb87 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -75,7 +75,7 @@ TEST(stdio, getdelim) { // It should set the end-of-file indicator for the stream, though. errno = 0; ASSERT_EQ(getdelim(&word_read, &allocated_length, ' ', fp), -1); - ASSERT_EQ(errno, 0); + ASSERT_EQ(0, errno); ASSERT_TRUE(feof(fp)); free(word_read); @@ -91,18 +91,18 @@ TEST(stdio, getdelim_invalid) { // The first argument can't be NULL. errno = 0; ASSERT_EQ(getdelim(NULL, &buffer_length, ' ', fp), -1); - ASSERT_EQ(errno, EINVAL); + ASSERT_EQ(EINVAL, errno); // The second argument can't be NULL. errno = 0; ASSERT_EQ(getdelim(&buffer, NULL, ' ', fp), -1); - ASSERT_EQ(errno, EINVAL); + ASSERT_EQ(EINVAL, errno); // The stream can't be closed. fclose(fp); errno = 0; ASSERT_EQ(getdelim(&buffer, &buffer_length, ' ', fp), -1); - ASSERT_EQ(errno, EBADF); + ASSERT_EQ(EBADF, errno); } TEST(stdio, getline) { @@ -140,7 +140,7 @@ TEST(stdio, getline) { // It should set the end-of-file indicator for the stream, though. errno = 0; ASSERT_EQ(getline(&line_read, &allocated_length, fp), -1); - ASSERT_EQ(errno, 0); + ASSERT_EQ(0, errno); ASSERT_TRUE(feof(fp)); free(line_read); @@ -156,16 +156,16 @@ TEST(stdio, getline_invalid) { // The first argument can't be NULL. errno = 0; ASSERT_EQ(getline(NULL, &buffer_length, fp), -1); - ASSERT_EQ(errno, EINVAL); + ASSERT_EQ(EINVAL, errno); // The second argument can't be NULL. errno = 0; ASSERT_EQ(getline(&buffer, NULL, fp), -1); - ASSERT_EQ(errno, EINVAL); + ASSERT_EQ(EINVAL, errno); // The stream can't be closed. fclose(fp); errno = 0; ASSERT_EQ(getline(&buffer, &buffer_length, fp), -1); - ASSERT_EQ(errno, EBADF); + ASSERT_EQ(EBADF, errno); } |