summaryrefslogtreecommitdiff
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r--tests/stdio_test.cpp16
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);
}