/[ascend]/trunk/ascend/integrator/test/test_lsode.c
ViewVC logotype

Diff of /trunk/ascend/integrator/test/test_lsode.c

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

revision 2551 by jpye, Tue Nov 8 09:08:17 2011 UTC revision 2552 by jpye, Thu Feb 2 20:54:40 2012 UTC
# Line 32  Line 32 
32  #include <ascend/compiler/safe.h>  #include <ascend/compiler/safe.h>
33  #include <ascend/compiler/qlfdid.h>  #include <ascend/compiler/qlfdid.h>
34  #include <ascend/compiler/instance_io.h>  #include <ascend/compiler/instance_io.h>
35    #include <ascend/compiler/packages.h>
36    
37  #include <ascend/compiler/slvreq.h>  #include <ascend/compiler/slvreq.h>
38    
# Line 73  static IntegratorReporter test_lsode_rep Line 74  static IntegratorReporter test_lsode_rep
74      Test solving a simple IPOPT model      Test solving a simple IPOPT model
75  */  */
76  static void test_bounds(){  static void test_bounds(){
   
     struct module_t *m;  
   
77      Asc_CompilerInit(1);      Asc_CompilerInit(1);
78      Asc_PutEnv(ASC_ENV_LIBRARY "=models:solvers/qrslv:solvers/lsode");      CU_TEST(0 == Asc_PutEnv(ASC_ENV_LIBRARY "=models"));
79      SlvRegisterStandardClients();      CU_TEST(0 == Asc_PutEnv(ASC_ENV_SOLVERS "=solvers/qrslv" OSPATH_DIV "solvers/lsode"));
80        char *lib = Asc_GetEnv(ASC_ENV_SOLVERS);
81        CONSOLE_DEBUG("%s = %s\n",ASC_ENV_SOLVERS,lib);
82        ASC_FREE(lib);
83    
84        CU_TEST_FATAL(0 == package_load("qrslv",NULL));
85    
86      /* load the file */      /* load the file */
87      char path[PATH_MAX];      char path[PATH_MAX];
# Line 88  static void test_bounds(){ Line 91  static void test_bounds(){
91      strncat(path, ".a4c", PATH_MAX - strlen(path));      strncat(path, ".a4c", PATH_MAX - strlen(path));
92      {      {
93          int status;          int status;
94          m = Asc_OpenModule(path,&status);          Asc_OpenModule(path,&status);
95          CU_ASSERT_FATAL(status == 0);          CU_ASSERT_FATAL(status == 0);
96      }      }
97    
# Line 117  static void test_bounds(){ Line 120  static void test_bounds(){
120    
121      slv_system_t sys = system_build(GetSimulationRoot(siminst));      slv_system_t sys = system_build(GetSimulationRoot(siminst));
122      CU_ASSERT_FATAL(sys != NULL);      CU_ASSERT_FATAL(sys != NULL);
123        
124      CU_ASSERT_FATAL(slv_select_solver(sys,index));      CU_ASSERT_FATAL(slv_select_solver(sys,index));
125      CONSOLE_DEBUG("Assigned solver '%s'...",solvername);      CONSOLE_DEBUG("Assigned solver '%s'...",solvername);
126    
127      /* create the integrator */      /* create the integrator */
128    
129      IntegratorSystem *integ = integrator_new(sys,siminst);      IntegratorSystem *integ = integrator_new(sys,siminst);
130        
131      CU_ASSERT_FATAL(0 == integrator_set_engine(integ,"LSODE"));      CU_ASSERT_FATAL(0 == integrator_set_engine(integ,"LSODE"));
132      CONSOLE_DEBUG("Assigned integrator '%s'...",integ->internals->name);      CONSOLE_DEBUG("Assigned integrator '%s'...",integ->internals->name);
133    
# Line 163  static void test_bounds(){ Line 166  static void test_bounds(){
166    
167      integrator_free(integ);      integrator_free(integ);
168      samplelist_free(samplelist);      samplelist_free(samplelist);
169        
170      CU_ASSERT_FATAL(NULL != sys);      CU_ASSERT_FATAL(NULL != sys);
171      system_destroy(sys);      system_destroy(sys);
172      system_free_reused_mem();      system_free_reused_mem();

Legend:
Removed from v.2551  
changed lines
  Added in v.2552

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