[libc-commits] [libc] [libc] Move strfrom* test cases into each respective unit test. (PR #218474)

Alex Strelnikov via libc-commits libc-commits at lists.llvm.org
Tue Aug 25 07:11:53 PDT 2026


================
@@ -6,8 +6,234 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "StrfromTest.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/properties/architectures.h"
 #include "src/stdlib/strfromd.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
-STRFROM_TEST(double, Strfromd, LIBC_NAMESPACE::strfromd)
+#define EXPECT_STREQ_LEN(str_size_needed, actual_str, expected_str)            \
+  EXPECT_EQ(str_size_needed, static_cast<int>(sizeof(expected_str) - 1));      \
+  EXPECT_STREQ(actual_str, expected_str);
+
+struct LlvmLibcStrfromdTest : LIBC_NAMESPACE::testing::ErrnoCheckingTest {};
----------------
strel-12 wrote:

Done. I had not noticed the pattern here yet and was just used to the pattern of always deriving for fixtures.

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


More information about the libc-commits mailing list