Compatiblity with C++
This commit is contained in:
1 parent
1ff9848384
commit
d9c3724cff
1 file changed
+6
@@ -23,6 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
# if !defined(__cplusplus)
|
||||||
// The test shall finish with a raise fatal.
|
// The test shall finish with a raise fatal.
|
||||||
#define M_RAISE_FATAL(...) do { \
|
#define M_RAISE_FATAL(...) do { \
|
||||||
if (test_final_in_progress == true) { \
|
if (test_final_in_progress == true) { \
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
|
|
||||||
// Is false by default.
|
// Is false by default.
|
||||||
static bool test_final_in_progress;
|
static bool test_final_in_progress;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "test-obj.h"
|
#include "test-obj.h"
|
||||||
#include "coverage.h"
|
#include "coverage.h"
|
||||||
@@ -442,8 +444,12 @@ static void test3(void)
|
|||||||
static void test_final(void)
|
static void test_final(void)
|
||||||
{
|
{
|
||||||
// Throw without a try block shall raise the M_RAISE_FATAL macro
|
// Throw without a try block shall raise the M_RAISE_FATAL macro
|
||||||
|
# if !defined(__cplusplus)
|
||||||
test_final_in_progress = true;
|
test_final_in_progress = true;
|
||||||
M_THROW(1);
|
M_THROW(1);
|
||||||
|
#else
|
||||||
|
exit(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|||||||
Reference in new issue
Block a user