Skip to content

Commit

Permalink
Merge pull request xtensor-stack#2712 from JohanMabille/noexception
Browse files Browse the repository at this point in the history
Removed bad macro definitions
  • Loading branch information
JohanMabille authored Jun 10, 2023
2 parents 779c374 + 059510b commit 0621c5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#if defined(XTENSOR_DISABLE_EXCEPTIONS)
#define DOCTEST_CONFIG_NO_EXCEPTIONS
#define DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
#endif
#include "doctest/doctest.h"
12 changes: 6 additions & 6 deletions test/test_common_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define TEST_COMMON_MACROS_HPP

#if defined(XTENSOR_DISABLE_EXCEPTIONS)
#define DOCTEST_CONFIG_NO_EXCEPTIONS
#define DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
#endif

#include "xtensor/xtensor_config.hpp"
Expand All @@ -11,11 +11,11 @@
#include "test_utils.hpp"

#if defined(XTENSOR_DISABLE_EXCEPTIONS)

#define XT_EXPECT_THROW(x, y) #warning "XT_EXPECT_THROW IS DISABLED WHEN EXCEPTIONS ARE DISABLED" ;
#define XT_ASSERT_THROW(x, y) #warning "XT_ASSERT_THROW IS DISABLED WHEN EXCEPTIONS ARE DISABLED" ;
#define XT_EXPECT_ANY_THROW(x) #warning "XT_EXPECT_ANY_THROW IS DISABLED WHEN EXCEPTIONS ARE DISABLED" ;
#define XT_ASSERT_ANY_THROW(x) #warning "XT_ASSERT_ANY_THROW IS DISABLED WHEN EXCEPTIONS ARE DISABLED" ;
#warning "XT_EXPECT_THROW, XT_ASSERT_THROW, XT_EXPECT_ANY_THROW and XT_ASSERT_ANY_THROW are disabled"
#define XT_EXPECT_THROW(x, y)
#define XT_ASSERT_THROW(x, y)
#define XT_EXPECT_ANY_THROW(x)
#define XT_ASSERT_ANY_THROW(x)
#define XT_EXPECT_NO_THROW(x) x;
#define XT_ASSERT_NO_THROW(x) x;

Expand Down
3 changes: 2 additions & 1 deletion test/test_xrandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <type_traits>

#include "test_common_macros.hpp"
#if (defined(__GNUC__) && !defined(__clang__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Expand All @@ -22,6 +21,8 @@
#include "xtensor/xset_operation.hpp"
#include "xtensor/xview.hpp"

#include "test_common_macros.hpp"

namespace xt
{
TEST(xrandom, random)
Expand Down

0 comments on commit 0621c5f

Please sign in to comment.