| 22 |
*/ |
*/ |
| 23 |
|
|
| 24 |
#include <stdio.h> |
#include <stdio.h> |
| 25 |
|
#include <utilities/ascConfig.h> |
| 26 |
|
#ifdef __WIN32__ |
| 27 |
#include <io.h> |
#include <io.h> |
| 28 |
#include "utilities/ascConfig.h" |
#endif |
| 29 |
#include "utilities/ascMalloc.h" |
#include <utilities/ascMalloc.h> |
| 30 |
#include "utilities/ascPanic.h" |
#include <utilities/ascPanic.h> |
| 31 |
#include "compiler/redirectFile.h" |
/* #include <compiler/redirectFile.h> */ |
| 32 |
#include "CUnit/CUnit.h" |
#include "CUnit/CUnit.h" |
| 33 |
#include "test_ascPanic.h" |
#include "test_ascPanic.h" |
| 34 |
#include "assertimpl.h" |
#include "assertimpl.h" |
| 38 |
static int f_callback_status; |
static int f_callback_status; |
| 39 |
|
|
| 40 |
/* |
/* |
| 41 |
|
These tests have been disabled as the stream redirection in ASCEND is |
| 42 |
|
starting to be a bit crazy: error.c --> ascPrint.h --> redirectFile.h |
| 43 |
|
as well as printutil.c and redirectStdStreams.c. Will set this test to |
| 44 |
|
failing and we'll come back and reimplement this later. |
| 45 |
|
*/ |
| 46 |
|
|
| 47 |
|
static void test_ascPanic(void){ |
| 48 |
|
CU_FAIL("test_ascPanic needs to be reimplemented"); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
#ifdef REIMPLEMENT_STREAMS |
| 52 |
|
|
| 53 |
|
/* |
| 54 |
* Callback function for Asc_Panic() during testing. |
* Callback function for Asc_Panic() during testing. |
| 55 |
* Sets a flag, then returns non-zero so program continues. |
* Sets a flag, then returns non-zero so program continues. |
| 56 |
*/ |
*/ |
| 66 |
* 1. most of its action is text formatting & output |
* 1. most of its action is text formatting & output |
| 67 |
* 2. it normally exits the program |
* 2. it normally exits the program |
| 68 |
* |
* |
| 69 |
* As a first pass, we will disable exiting and just test |
* As a first pass, we will disable exiting and just test |
| 70 |
* whether something is getting written to ASCERR and an |
* whether something is getting written to ASCERR and an |
| 71 |
* output file. |
* output file. |
| 72 |
*/ |
*/ |
| 75 |
FILE *stdoutfile; |
FILE *stdoutfile; |
| 76 |
FILE* outfile; |
FILE* outfile; |
| 77 |
int i_enabled_printing = FALSE; |
int i_enabled_printing = FALSE; |
| 78 |
FILE *old_errfile; |
FILE *old_errfile; |
| 79 |
FILE *old_warnfile; |
FILE *old_warnfile; |
| 80 |
FILE *old_infofile; |
FILE *old_infofile; |
| 81 |
unsigned long prior_meminuse; |
unsigned long prior_meminuse; |
| 184 |
Asc_RedirectCompilerStreams(old_errfile, old_warnfile, old_infofile); /* restore streams */ |
Asc_RedirectCompilerStreams(old_errfile, old_warnfile, old_infofile); /* restore streams */ |
| 185 |
CU_TEST(prior_meminuse == ascmeminuse()); /* make sure we cleaned up after ourselves */ |
CU_TEST(prior_meminuse == ascmeminuse()); /* make sure we cleaned up after ourselves */ |
| 186 |
} |
} |
| 187 |
|
#endif /* REIMPLEMENT_STREAMS */ |
| 188 |
|
|
| 189 |
/*===========================================================================*/ |
/*===========================================================================*/ |
| 190 |
/* Registration information */ |
/* Registration information */ |