mirror of
https://github.com/catchorg/Catch2.git
synced 2025-04-29 04:03:51 +00:00
Compare commits
4 Commits
6c9a255dc2
...
fa6211bfc2
Author | SHA1 | Date | |
---|---|---|---|
|
fa6211bfc2 | ||
|
4e90f910dc | ||
|
0c59cc83cf | ||
|
e4004e0adb |
@ -55,11 +55,15 @@ namespace Catch {
|
|||||||
template <typename U>
|
template <typename U>
|
||||||
void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
|
void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
|
||||||
|
|
||||||
T& stored_object()
|
T& stored_object() {
|
||||||
{
|
|
||||||
return *static_cast<T*>(static_cast<void*>(&data));
|
return *static_cast<T*>(static_cast<void*>(&data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
T const& stored_object() const {
|
||||||
|
return *static_cast<T*>(static_cast<void*>(&data));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TStorage data;
|
TStorage data;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ namespace {
|
|||||||
|
|
||||||
bool useColourOnPlatform() {
|
bool useColourOnPlatform() {
|
||||||
return
|
return
|
||||||
#ifdef CATCH_PLATFORM_MAC
|
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
|
||||||
!isDebuggerActive() &&
|
!isDebuggerActive() &&
|
||||||
#endif
|
#endif
|
||||||
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
|
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "catch_stream.h"
|
#include "catch_stream.h"
|
||||||
#include "catch_platform.h"
|
#include "catch_platform.h"
|
||||||
|
|
||||||
#ifdef CATCH_PLATFORM_MAC
|
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
|
||||||
|
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
|
@ -19,6 +19,17 @@ namespace Catch {
|
|||||||
|
|
||||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||||
|
|
||||||
|
#elif defined(CATCH_PLATFORM_IPHONE)
|
||||||
|
|
||||||
|
// use inline assembler
|
||||||
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
|
#define CATCH_TRAP() __asm__("int $3")
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
|
||||||
|
#elif defined(__arm__)
|
||||||
|
#define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined(CATCH_PLATFORM_LINUX)
|
#elif defined(CATCH_PLATFORM_LINUX)
|
||||||
// If we can use inline assembler, do it because this allows us to break
|
// If we can use inline assembler, do it because this allows us to break
|
||||||
// directly at the location of the failing check instead of breaking inside
|
// directly at the location of the failing check instead of breaking inside
|
||||||
|
Loading…
x
Reference in New Issue
Block a user