File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 4141// they all provide.
4242
4343#define ASSERT_ERRNO_EQ (VAL ) \
44- ASSERT_EQ (VAL, static_cast <int >(LIBC_NAMESPACE::libc_errno)); \
45- LIBC_NAMESPACE::libc_errno = 0
44+ do { \
45+ ASSERT_EQ (VAL, static_cast <int >(LIBC_NAMESPACE::libc_errno)); \
46+ LIBC_NAMESPACE::libc_errno = 0 ; \
47+ } while (0 )
4648#define ASSERT_ERRNO_SUCCESS () \
4749 ASSERT_EQ (0 , static_cast <int >(LIBC_NAMESPACE::libc_errno))
4850#define ASSERT_ERRNO_FAILURE () \
49- ASSERT_NE (0 , static_cast <int >(LIBC_NAMESPACE::libc_errno)); \
50- LIBC_NAMESPACE::libc_errno = 0
51+ do { \
52+ ASSERT_NE (0 , static_cast <int >(LIBC_NAMESPACE::libc_errno)); \
53+ LIBC_NAMESPACE::libc_errno = 0 ; \
54+ } while (0 )
5155
5256#endif // LLVM_LIBC_TEST_UNITTEST_TEST_H
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ using LlvmLibcAccessTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
2222TEST_F (LlvmLibcAccessTest, CreateAndTest) {
2323 // The test strategy is to repeatedly create a file in different modes and
2424 // test that it is accessable in those modes but not in others.
25- using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
2625 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
26+ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
2727 constexpr const char *FILENAME = " access.test" ;
2828 auto TEST_FILE = libc_make_test_file_path (FILENAME);
2929 int fd = LIBC_NAMESPACE::open (TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
You can’t perform that action at this time.
0 commit comments