[libc-commits] [PATCH] D72743: [libc] Replace the use of gtest with a new light weight unittest framework.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jan 17 16:36:49 PST 2020


sivachandra marked 5 inline comments as done.
sivachandra added a comment.

I modified to use `switch` statements as suggested before submitting.



================
Comment at: libc/test/config/linux/x86_64/syscall_test.cpp:12
 
 #include <functional>
 
----------------
abrachet wrote:
> Should we get rid of this include too? Maybe just assign to function pointer? Or we could implement `std::is_same`?
Yes, it should go. I have kept it for now as I have a different plan for things like these. Will write about them in detail soon.


================
Comment at: libc/test/src/string/strcat_test.cpp:35
   ASSERT_EQ(dest, result);
-  ASSERT_EQ(std::string(dest), std::string("xyz") + abc);
-  ASSERT_EQ(std::string(dest).size(), abc.size() + 3);
+  ASSERT_STREQ(dest, result);
+  ASSERT_STREQ(dest, "xyzabc");
----------------
abrachet wrote:
> I guess we don't really need these STREQ anymore. 
No harm to keep them I guess :)


================
Comment at: libc/utils/UnitTest/Test.h:95
+
+  static int runTests();
+
----------------
phosek wrote:
> Why not `bool` as a return value`?
The main function can then just return the result of `runTests`.  I don't think `bool` return value disallows it, but I don't like the implicit nature of such conversions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72743





More information about the libc-commits mailing list