FMI Library: part of JModelica.org
Macros | Functions | Variables
fmi1_capi_me_test.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <fmilib.h>
#include "config_test.h"
#include <FMI1/fmi1_capi.h>
#include <fmu_dummy/fmu1_model_defines.h>

Go to the source code of this file.

Macros

#define MODEL_IDENTIFIER   FMU_DUMMY_ME_MODEL_IDENTIFIER
 
#define INSTANCE_NAME   "Test Model"
 

Functions

void importlogger (jm_callbacks *c, jm_string module, jm_log_level_enu_t log_level, jm_string message)
 
void fmilogger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)
 
void do_exit (int code)
 
int test_create_dllfmu ()
 Tests fmi1_capi_create_dllfmu. More...
 
int test_load_dll ()
 Tests fmi1_capi_load_dll. More...
 
int test_load_dll_fcn ()
 Tests fmi1_capi_load_fcn. More...
 
int test_fmi_get_version ()
 Tests fmi1_capi_get_version. More...
 
int test_fmi_get_model_types_platform ()
 Tests fmi1_capi_get_model_types_platform. More...
 
int test_instantiate_model ()
 Tests fmi1_capi_instantiate_model. More...
 
int test_fmi_set_time ()
 Tests fmi1_capi_set_time. More...
 
int test_set_continuous_states ()
 Tests fmi1_capi_set_continuous_states. More...
 
int test_initialize ()
 Tests fmi1_capi_initialize. More...
 
int test_completed_integrator_step ()
 Tests fmi1_capi_completed_integrator_step. More...
 
int test_get_derivatives ()
 Tests fmi1_capi_get_derivatives. More...
 
int test_get_event_indicators ()
 
int test_event_update ()
 Tests fmi1_capi_eventUpdate. More...
 
int test_get_continuous_states ()
 Tests fmi1_capi_get_continuous_states. More...
 
int test_get_nominal_continuous_states ()
 Tests fmi1_capi_get_nominal_continuous_states. More...
 
int test_get_state_value_references ()
 Tests fmi1_capi_get_state_value_references. More...
 
int test_set_debug_logging ()
 Tests fmi1_capi_set_debug_logging. More...
 
int test_set_get_string ()
 Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The same values are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set. More...
 
int test_set_get_integer ()
 Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The same values are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set. More...
 
int test_set_get_boolean ()
 Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. The same values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set. More...
 
int test_set_get_real ()
 Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same values are retrived with fmi1_capi_get_real and tested to be the same as thoughs that were set. More...
 
int test_terminate ()
 Tests fmi1_capi_terminate. More...
 
int test_free_model_instance ()
 Tests fmi1_capi_free_model_instance. More...
 
int test_free_dll ()
 Tests fmi1_capi_free_dll. More...
 
int test_destroy_dllfmu ()
 Tests fmi1_capi_destroy_dllfmu. More...
 
int main (int argc, char *argv[])
 Tests the C-API for FMI 1.0 Model Exchange. The tests are performed using a test-dll. The functions are called and the values are set or returned are validated either in the test function(output functions) or inside the dll(input functions). If any error occures, the program exits. More...
 

Variables

fmi1_capi_t * fmu
 
jm_callbackscallbacks
 

Macro Definition Documentation

#define MODEL_IDENTIFIER   FMU_DUMMY_ME_MODEL_IDENTIFIER

Definition at line 34 of file fmi1_capi_me_test.c.

#define INSTANCE_NAME   "Test Model"

Definition at line 37 of file fmi1_capi_me_test.c.

Function Documentation

void importlogger ( jm_callbacks c,
jm_string  module,
jm_log_level_enu_t  log_level,
jm_string  message 
)

Definition at line 42 of file fmi1_capi_me_test.c.

void fmilogger ( fmi1_component_t  c,
fmi1_string_t  instanceName,
fmi1_status_t  status,
fmi1_string_t  category,
fmi1_string_t  message,
  ... 
)

Definition at line 48 of file fmi1_capi_me_test.c.

void do_exit ( int  code)

Definition at line 62 of file fmi1_capi_me_test.c.

int test_create_dllfmu ( )

Tests fmi1_capi_create_dllfmu.

Definition at line 75 of file fmi1_capi_me_test.c.

int test_load_dll ( )

Tests fmi1_capi_load_dll.

Definition at line 108 of file fmi1_capi_me_test.c.

int test_load_dll_fcn ( )

Tests fmi1_capi_load_fcn.

Definition at line 127 of file fmi1_capi_me_test.c.

int test_fmi_get_version ( )

Tests fmi1_capi_get_version.

Definition at line 147 of file fmi1_capi_me_test.c.

int test_fmi_get_model_types_platform ( )

Tests fmi1_capi_get_model_types_platform.

Definition at line 165 of file fmi1_capi_me_test.c.

int test_instantiate_model ( )

Tests fmi1_capi_instantiate_model.

Definition at line 183 of file fmi1_capi_me_test.c.

int test_fmi_set_time ( )

Tests fmi1_capi_set_time.

Definition at line 200 of file fmi1_capi_me_test.c.

int test_set_continuous_states ( )

Tests fmi1_capi_set_continuous_states.

Definition at line 217 of file fmi1_capi_me_test.c.

int test_initialize ( )

Tests fmi1_capi_initialize.

Definition at line 246 of file fmi1_capi_me_test.c.

int test_completed_integrator_step ( )

Tests fmi1_capi_completed_integrator_step.

Definition at line 277 of file fmi1_capi_me_test.c.

int test_get_derivatives ( )

Tests fmi1_capi_get_derivatives.

Definition at line 299 of file fmi1_capi_me_test.c.

int test_get_event_indicators ( )

Definition at line 320 of file fmi1_capi_me_test.c.

int test_event_update ( )

Tests fmi1_capi_eventUpdate.

Definition at line 345 of file fmi1_capi_me_test.c.

int test_get_continuous_states ( )

Tests fmi1_capi_get_continuous_states.

Definition at line 373 of file fmi1_capi_me_test.c.

int test_get_nominal_continuous_states ( )

Tests fmi1_capi_get_nominal_continuous_states.

Definition at line 398 of file fmi1_capi_me_test.c.

int test_get_state_value_references ( )

Tests fmi1_capi_get_state_value_references.

Definition at line 423 of file fmi1_capi_me_test.c.

int test_set_debug_logging ( )

Tests fmi1_capi_set_debug_logging.

Definition at line 448 of file fmi1_capi_me_test.c.

int test_set_get_string ( )

Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The same values are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set.

Definition at line 465 of file fmi1_capi_me_test.c.

int test_set_get_integer ( )

Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The same values are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set.

Definition at line 510 of file fmi1_capi_me_test.c.

int test_set_get_boolean ( )

Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. The same values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set.

Definition at line 555 of file fmi1_capi_me_test.c.

int test_set_get_real ( )

Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same values are retrived with fmi1_capi_get_real and tested to be the same as thoughs that were set.

Definition at line 600 of file fmi1_capi_me_test.c.

int test_terminate ( )

Tests fmi1_capi_terminate.

Definition at line 646 of file fmi1_capi_me_test.c.

int test_free_model_instance ( )

Tests fmi1_capi_free_model_instance.

Definition at line 664 of file fmi1_capi_me_test.c.

int test_free_dll ( )

Tests fmi1_capi_free_dll.

Definition at line 675 of file fmi1_capi_me_test.c.

int test_destroy_dllfmu ( )

Tests fmi1_capi_destroy_dllfmu.

Definition at line 686 of file fmi1_capi_me_test.c.

int main ( int  argc,
char argv[] 
)

Tests the C-API for FMI 1.0 Model Exchange. The tests are performed using a test-dll. The functions are called and the values are set or returned are validated either in the test function(output functions) or inside the dll(input functions). If any error occures, the program exits.

Definition at line 698 of file fmi1_capi_me_test.c.

Variable Documentation

fmi1_capi_t* fmu

Definition at line 39 of file fmi1_capi_me_test.c.

jm_callbacks* callbacks

Definition at line 69 of file fmi1_capi_me_test.c.