/[ascend]/trunk/base/generic/utilities/test/test_ascPanic.c
ViewVC logotype

Diff of /trunk/base/generic/utilities/test/test_ascPanic.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 59 by jds, Sun Oct 30 01:38:20 2005 UTC revision 928 by johnpye, Wed Nov 22 10:32:18 2006 UTC
# Line 22  Line 22 
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"
# Line 36  static int f_callback_called = FALSE; Line 38  static int f_callback_called = FALSE;
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   */   */
# Line 51  static int set_flag_and_return(int statu Line 66  static int set_flag_and_return(int statu
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   */   */
# Line 60  static void test_ascPanic(void) Line 75  static void test_ascPanic(void)
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;
# Line 169  static void test_ascPanic(void) Line 184  static void test_ascPanic(void)
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 */

Legend:
Removed from v.59  
changed lines
  Added in v.928

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22