mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-18 01:31:04 -05:00
CMakeLibTests: include testCommon.h for ASSERT_TRUE
And remove duplicate definitions.
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "cmArgumentParser.h"
|
||||
#include "cmArgumentParserTypes.h"
|
||||
|
||||
#include "testCommon.h"
|
||||
|
||||
namespace {
|
||||
|
||||
struct Result : public ArgumentParser::ParseResult
|
||||
@@ -182,14 +184,6 @@ bool verifyResult(Result const& result,
|
||||
static std::vector<std::string> const unparsed = { "pos2", "bar", "ign1",
|
||||
"ign2", "ign4" };
|
||||
|
||||
#define ASSERT_TRUE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
|
||||
return false; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
ASSERT_TRUE(!result);
|
||||
|
||||
ASSERT_TRUE(result.Option1);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -12,13 +11,7 @@
|
||||
#include "cmJSONHelpers.h"
|
||||
#include "cmJSONState.h"
|
||||
|
||||
#define ASSERT_TRUE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
|
||||
return false; \
|
||||
} \
|
||||
} while (false)
|
||||
#include "testCommon.h"
|
||||
|
||||
namespace {
|
||||
struct ObjectStruct
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <cm/optional>
|
||||
#include <cm/utility>
|
||||
|
||||
#include "testCommon.h"
|
||||
|
||||
class EventLogger;
|
||||
|
||||
class Event
|
||||
@@ -93,14 +95,6 @@ public:
|
||||
NoMoveAssignEventLogger& operator=(NoMoveAssignEventLogger&&) = delete;
|
||||
};
|
||||
|
||||
#define ASSERT_TRUE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
|
||||
return false; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
// Certain builds of GCC generate false -Wmaybe-uninitialized warnings when
|
||||
// doing a release build with the system version of std::optional. These
|
||||
// warnings do not manifest when using our own cm::optional implementation.
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cmRange.h"
|
||||
|
||||
#define ASSERT_TRUE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
|
||||
return -1; \
|
||||
} \
|
||||
} while (false)
|
||||
#include "testCommon.h"
|
||||
|
||||
int testRange(int /*unused*/, char* /*unused*/[])
|
||||
{
|
||||
|
||||
@@ -14,13 +14,7 @@
|
||||
|
||||
#include "cmString.hxx"
|
||||
|
||||
#define ASSERT_TRUE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
|
||||
return false; \
|
||||
} \
|
||||
} while (false)
|
||||
#include "testCommon.h"
|
||||
|
||||
static bool testConstructDefault()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user