[zircon][ulib][zxtest] Swap args in ASSERT_OK to match (expected, actual) order
Change the order of the arguments passed to the underlying
_ASSERT_VAR_STATUS macros so that "expected" comes before
"actual". This matches what we do in the other macros and matches
_ASSERT_VAR_STATUS's "prototype".
Now, when an ASSERT_OK fails, the printed message correctly identifies
the tested argument as "actual". For example,
zx_status_t status = ZX_ERR_BAD_STATE;
EXPECT_OK(ZX_ERR_BAD_STATE);
now yields:
Expected: ZX_OK
Actual : status
Which is: ZX_ERR_BAD_STATE
Test: Ran exiting integration tests and observed the output
Change-Id: I9e1af9e8c1d78e77f39506465282aa8bc5ae8745
diff --git a/zircon/system/ulib/zxtest/include/zxtest/zxtest.h b/zircon/system/ulib/zxtest/include/zxtest/zxtest.h
index 1953932..ee5b1c8 100644
--- a/zircon/system/ulib/zxtest/include/zxtest/zxtest.h
+++ b/zircon/system/ulib/zxtest/include/zxtest/zxtest.h
@@ -121,19 +121,19 @@
"Expected " #val1 " non null pointer.", ##__VA_ARGS__)
#define ASSERT_OK(val1, ...) \
- _ASSERT_VAR_STATUS(_EQ, val1, ZX_OK, true, __FILE__, __LINE__, "Expected " #val1 " is ZX_OK.", \
+ _ASSERT_VAR_STATUS(_EQ, ZX_OK, val1, true, __FILE__, __LINE__, "Expected " #val1 " is ZX_OK.", \
##__VA_ARGS__)
#define EXPECT_OK(val1, ...) \
- _ASSERT_VAR_STATUS(_EQ, val1, ZX_OK, false, __FILE__, __LINE__, \
+ _ASSERT_VAR_STATUS(_EQ, ZX_OK, val1, false, __FILE__, __LINE__, \
"Expected " #val1 " is ZX_OK.", ##__VA_ARGS__)
#define ASSERT_NOT_OK(val1, ...) \
- _ASSERT_VAR_STATUS(_NE, val1, ZX_OK, true, __FILE__, __LINE__, \
+ _ASSERT_VAR_STATUS(_NE, ZX_OK, val1, true, __FILE__, __LINE__, \
"Expected " #val1 " is not ZX_OK.", ##__VA_ARGS__)
#define EXPECT_NOT_OK(val1, ...) \
- _ASSERT_VAR_STATUS(_NE, val1, ZX_OK, false, __FILE__, __LINE__, \
+ _ASSERT_VAR_STATUS(_NE, ZX_OK, val1, false, __FILE__, __LINE__, \
"Expected " #val1 " is not ZX_OK.", ##__VA_ARGS__)
#define ASSERT_BYTES_EQ(val1, val2, size, ...) \