[libc-commits] [libc] [fuchsia][libc] Include missing macro definitions (PR #79639)

via libc-commits libc-commits at lists.llvm.org
Fri Jan 26 11:20:17 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Caslyn Tonelli (Caslyn)

<details>
<summary>Changes</summary>

PR 79573 introduced `ASSERT_ERRNO_*` macros for use in libc tests. Introduce these macro definitions to FuchsiaTest.h for string tests to compile on Fuchsia.

---
Full diff: https://github.com/llvm/llvm-project/pull/79639.diff


1 Files Affected:

- (modified) libc/test/UnitTest/FuchsiaTest.h (+5) 


``````````diff
diff --git a/libc/test/UnitTest/FuchsiaTest.h b/libc/test/UnitTest/FuchsiaTest.h
index 07a6e9b3f6bde5a..1b7537965813989 100644
--- a/libc/test/UnitTest/FuchsiaTest.h
+++ b/libc/test/UnitTest/FuchsiaTest.h
@@ -13,6 +13,11 @@
 
 #define WITH_SIGNAL(X) #X
 
+// These macros are used in string unittests.
+#define ASSERT_ERRNO_EQ(VAL) ASSERT_EQ(VAL, static_cast<int>(libc_errno))
+#define ASSERT_ERRNO_SUCCESS() ASSERT_EQ(0, static_cast<int>(libc_errno))
+#define ASSERT_ERRNO_FAILURE() ASSERT_NE(0, static_cast<int>(libc_errno))
+
 #ifndef EXPECT_DEATH
 // Since zxtest has ASSERT_DEATH but not EXPECT_DEATH, wrap calling it
 // in a lambda returning void to swallow any early returns so that this

``````````

</details>


https://github.com/llvm/llvm-project/pull/79639


More information about the libc-commits mailing list