[libc-commits] [PATCH] D73668: [libc] Add [EXPECT|ASSERT]_[TRUE|FALSE] unittest macros.

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jan 30 11:47:29 PST 2020


abrachet accepted this revision.
abrachet added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/utils/UnitTest/Test.h:66-67
   // of type promotion.
-  template <
-      typename ValType,
-      cpp::EnableIfType<cpp::IsIntegralNotBool<ValType>::Value, ValType> = 0>
+  template <typename ValType,
+            cpp::EnableIfType<cpp::IsIntegral<ValType>::Value, ValType> = 0>
   static bool test(RunContext &Ctx, TestCondition Cond, ValType LHS,
----------------
@gchatelet will be happy about this change :)


================
Comment at: libc/utils/UnitTest/Test.h:180-181
+#define EXPECT_TRUE(VAL)                                                       \
+  __llvm_libc::testing::Test::test(Ctx, __llvm_libc::testing::Cond_EQ, (VAL),  \
+                                   true, #VAL, "true", __FILE__, __LINE__)
+
----------------
Could we shorten this to `EXPECT_EQ(VAL, true)`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73668/new/

https://reviews.llvm.org/D73668





More information about the libc-commits mailing list