doctest

FORK: The fastest feature-rich C++11/14/17/20 single-header testing framework
git clone https://git.neptards.moe/neptards/doctest.git
Log | Files | Refs | README

namespace1.cpp (598B)


      1 #include <doctest/doctest.h>
      2 
      3 DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
      4 #include <cstdint>
      5 #include <sstream>
      6 DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
      7 
      8 namespace user1 {
      9 struct label
     10 {
     11     label()
     12             : i(0) {}
     13     int i;
     14 };
     15 } // namespace user1
     16 
     17 DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations")
     18 DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes")
     19 
     20 bool operator==(const user1::label& lhs, const user1::label& rhs) { return lhs.i == rhs.i; }
     21 
     22 
     23 TEST_CASE("namespace 1 global operator") {
     24     user1::label a;
     25     user1::label b;
     26     CHECK(a == b);
     27 }