1. Matt Oswald
  2. xUnit++

Commits

Matt Oswald  committed 30531f2

rewrote FACT/TIMED_FACT in terms of TIMED_FACT_FIXTURE

  • Participants
  • Parent commits 97f87bf
  • Branches default

Comments (0)

Files changed (2)

File xUnit++/main.cpp

View file
  • Ignore whitespace
         Equal(er, ar, [](double er, double ar) { return er == ar; });
     }
 
+    // !!! enable_if has std::begin, std::end
+    // then template on template of type T
     template<typename T, typename TComparer>
     void Equal(const std::vector<T> &expected, const std::vector<T> &actual, TComparer comparer) const
     {
         }
     }
 
+    // !!! enable_if has std::begin, std::end
+    // then template on template of type T
     template<typename T>
     void Equal(const std::vector<T> &expected, const std::vector<T> &actual) const
     {

File xUnit++/xUnitMacros.h

View file
  • Ignore whitespace
     } \
     namespace name ## _xUnitSuite
 
-#define TIMED_FACT(FactName, timeout) \
-    void FactName(); \
-    namespace FactName ## _ns { xUnitpp::TestCollection::Register reg(&FactName, #FactName, xUnitSuite::Name(), timeout, __FILE__, __LINE__); } \
-    void FactName()
-
-#define FACT(FactName) TIMED_FACT(FactName, -1)
-
-#define TIMED_THEORY(TheoryName, params, DataProvider, timeout) \
-    void TheoryName params; \
-    namespace TheoryName ## _ns { xUnitpp::TestCollection::Register reg(TheoryName, DataProvider, #TheoryName, xUnitSuite::Name(), timeout, __FILE__, __LINE__); } \
-    void TheoryName params
-
-#define THEORY(TheoryName, params, DataProvider) TIMED_THEORY(TheoryName, params, DataProvider, -1)
+namespace xUnitpp { struct NoFixture {}; }
 
 #define TIMED_FACT_FIXTURE(FactName, FixtureType, timeout) \
     namespace FactName ## _ns { \
 
 #define FACT_FIXTURE(FactName, FixtureType) TIMED_FACT_FIXTURE(FactName, FixtureType, -1)
 
+#define TIMED_FACT(FactName, timeout) TIMED_FACT_FIXTURE(FactName, xUnitpp::NoFixture, timeout)
+
+#define FACT(FactName) TIMED_FACT_FIXTURE(FactName, xUnitpp::NoFixture, -1)
+
+#define TIMED_THEORY(TheoryName, params, DataProvider, timeout) \
+    void TheoryName params; \
+    namespace TheoryName ## _ns { xUnitpp::TestCollection::Register reg(TheoryName, DataProvider, #TheoryName, xUnitSuite::Name(), timeout, __FILE__, __LINE__); } \
+    void TheoryName params
+
+#define THEORY(TheoryName, params, DataProvider) TIMED_THEORY(TheoryName, params, DataProvider, -1)
+
+#define ASSERT_EQUAL(expected, actual, comparer_or_precision)
+//#define ASSERT_EQUAL(expected, actual)
+#define ASSERT_NOT_EQUAL(expected, actual, comparer)
+//#define ASSERT_NOT_EQUAL(expected, actual)
+#define ASSERT_NO_THROW(expression)
+#define ASSERT_THROWS(expression)
+#define ASSERT_FAIL(message)
+#define ASSERT_FALSE(check, ...)
+#define ASSERT_TRUE(check, ...)
+#define ASSERT_EMPTY(container)
+#define ASSERT_NOT_EMPTY(container)
+#define ASSERT_DOES_NOT_CONTAIN(container, item)
+#define ASSERT_CONTAINS(container, item)
+#define ASSERT_IN_RANGE(value, min, max)
+#define ASSERT_NOT_IN_RANGE(value, min, max)
+#define ASSERT_NOT_NULL(value)
+#define ASSERT_NULL(value)
+#define ASSERT_NOT_SAME(value0, value1)
+#define ASSERT_SAME(value0, value1)
+
 #endif