/[ascend]/trunk/ascend/compiler/test/test_fixfree.c
ViewVC logotype

Diff of /trunk/ascend/compiler/test/test_fixfree.c

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

revision 2398 by jpye, Mon Feb 28 12:18:48 2011 UTC revision 2399 by jpye, Tue Mar 1 00:34:00 2011 UTC
# Line 93  static void test_test1(void){ Line 93  static void test_test1(void){
93      enum Proc_enum pe = Initialize(GetSimulationRoot(sim),name,"sim1", ASCERR, WP_STOPONERR, NULL, NULL);      enum Proc_enum pe = Initialize(GetSimulationRoot(sim),name,"sim1", ASCERR, WP_STOPONERR, NULL, NULL);
94      CU_ASSERT(pe==Proc_all_ok);      CU_ASSERT(pe==Proc_all_ok);
95    
96      CHECK_FIXED("x");      CHECK_FREE("x");
97      CHECK_FREE("y");      CHECK_FIXED("y");
98      CHECK_FREE("z");      CHECK_FREE("z");
99            
100      sim_destroy(sim);      sim_destroy(sim);
# Line 119  static void test_test2(void){ Line 119  static void test_test2(void){
119    
120      CHECK_FREE("y");      CHECK_FREE("y");
121      CHECK_FIXED("x");      CHECK_FIXED("x");
122      CHECK_FIXED("z");      CHECK_FREE("z"); /* we expect names after the wrong ones not to have been changed */
123        
124        sim_destroy(sim);
125        Asc_CompilerDestroy();
126    }
127    
128    static void test_test3(void){
129        struct Instance *sim = load_model("test3");
130    
131        /* check for vars and rels */
132        struct Instance *root = GetSimulationRoot(sim);
133        struct Instance *inst;
134    
135        CHECK_FREE("x");
136        CHECK_FREE("z");
137    
138        /** Call on_load */
139        struct Name *name = CreateIdName(AddSymbol("on_load"));
140        enum Proc_enum pe = Initialize(GetSimulationRoot(sim),name,"sim1", ASCERR, WP_STOPONERR, NULL, NULL);
141        CU_ASSERT(pe!=Proc_all_ok);
142    
143        CHECK_FIXED("x");
144        CHECK_FREE("z");
145            
146      sim_destroy(sim);      sim_destroy(sim);
147      Asc_CompilerDestroy();      Asc_CompilerDestroy();
148  }  }
149    
150    
151  /*===========================================================================*/  /*===========================================================================*/
152  /* Registration information */  /* Registration information */
153    
# Line 132  static void test_test2(void){ Line 155  static void test_test2(void){
155    
156  #define TESTS(T) \  #define TESTS(T) \
157      T(test1) \      T(test1) \
158      T(test2)      T(test2) \
159        T(test3)
160            
161  REGISTER_TESTS_SIMPLE(compiler_fixfree, TESTS)  REGISTER_TESTS_SIMPLE(compiler_fixfree, TESTS)
162    

Legend:
Removed from v.2398  
changed lines
  Added in v.2399

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