FMI Library: part of JModelica.org
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <JM/jm_types.h>
#include <JM/jm_portability.h>
#include <FMI1/fmi1_types.h>
#include <FMI1/fmi1_functions.h>
#include <FMI1/fmi1_capi.h>
#include <JM/jm_callbacks.h>
#include <fmu_dummy/fmu1_model_defines.h>
#include "config_test.h"
Go to the source code of this file.
Macros | |
#define | MODEL_IDENTIFIER FMU_DUMMY_CS_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_get_types_platform () |
Tests fmi1_capi_get_types_platform. More... | |
int | test_instantiate_slave () |
Tests fmi1_capi_instantiate_slave. More... | |
int | test_initialize_slave () |
Tests fmi1_capi_initialize_slave. More... | |
int | test_set_debug_logging () |
Tests fmi1_capi_set_debug_logging. More... | |
int | test_cancel_step () |
Tests fmi1_capi_cancel_step. More... | |
int | test_do_step () |
Tests fmi1_capi_do_step. More... | |
int | test_get_status () |
Tests fmi1_capi_get_status. More... | |
int | test_get_real_status () |
Tests fmi1_capi_get_real_status. More... | |
int | test_get_integer_status () |
Tests fmi1_capi_get_integer_status. More... | |
int | test_get_boolean_status () |
Tests fmi1_capi_get_boolean_status. More... | |
int | test_get_string_status () |
Tests fmi1_capi_get_string_status. 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_reset_slave () |
Tests fmi1_capi_reset_slave. More... | |
int | test_set_real_input_derivatives () |
Tests fmi1_capi_set_real_input_derivatives fmi1_capi_set_real_input_derivatives returns fmiError if wrong values are set. The values that are set are tested inside the DLL. More... | |
int | test_get_real_output_derivatives () |
Tests fmi1_capi_get_real_output_derivatives The output values from fmi1_capi_get_real_output_derivatives is expected to have a special value that is coded in the DLL. More... | |
int | test_terminate_slave () |
Tests fmi1_capi_terminate_slave. More... | |
int | test_free_slave_instance () |
Tests fmi1_capi_free_slave_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 Co-Simulation. 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_callbacks * | callbacks = 0 |
#define MODEL_IDENTIFIER FMU_DUMMY_CS_MODEL_IDENTIFIER |
Definition at line 32 of file fmi1_capi_cs_test.c.
#define INSTANCE_NAME "Test Model" |
Definition at line 35 of file fmi1_capi_cs_test.c.
void importlogger | ( | jm_callbacks * | c, |
jm_string | module, | ||
jm_log_level_enu_t | log_level, | ||
jm_string | message | ||
) |
Definition at line 40 of file fmi1_capi_cs_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 46 of file fmi1_capi_cs_test.c.
void do_exit | ( | int | code | ) |
Definition at line 60 of file fmi1_capi_cs_test.c.
int test_create_dllfmu | ( | ) |
Tests fmi1_capi_create_dllfmu.
Definition at line 73 of file fmi1_capi_cs_test.c.
int test_load_dll | ( | ) |
Tests fmi1_capi_load_dll.
Definition at line 107 of file fmi1_capi_cs_test.c.
int test_load_dll_fcn | ( | ) |
Tests fmi1_capi_load_fcn.
Definition at line 126 of file fmi1_capi_cs_test.c.
int test_fmi_get_version | ( | ) |
Tests fmi1_capi_get_version.
Definition at line 146 of file fmi1_capi_cs_test.c.
int test_get_types_platform | ( | ) |
Tests fmi1_capi_get_types_platform.
Definition at line 164 of file fmi1_capi_cs_test.c.
int test_instantiate_slave | ( | ) |
Tests fmi1_capi_instantiate_slave.
Definition at line 182 of file fmi1_capi_cs_test.c.
int test_initialize_slave | ( | ) |
Tests fmi1_capi_initialize_slave.
Definition at line 211 of file fmi1_capi_cs_test.c.
int test_set_debug_logging | ( | ) |
Tests fmi1_capi_set_debug_logging.
Definition at line 236 of file fmi1_capi_cs_test.c.
int test_cancel_step | ( | ) |
Tests fmi1_capi_cancel_step.
Definition at line 253 of file fmi1_capi_cs_test.c.
int test_do_step | ( | ) |
Tests fmi1_capi_do_step.
Definition at line 270 of file fmi1_capi_cs_test.c.
int test_get_status | ( | ) |
Tests fmi1_capi_get_status.
Definition at line 294 of file fmi1_capi_cs_test.c.
int test_get_real_status | ( | ) |
Tests fmi1_capi_get_real_status.
Definition at line 315 of file fmi1_capi_cs_test.c.
int test_get_integer_status | ( | ) |
Tests fmi1_capi_get_integer_status.
Definition at line 335 of file fmi1_capi_cs_test.c.
int test_get_boolean_status | ( | ) |
Tests fmi1_capi_get_boolean_status.
Definition at line 355 of file fmi1_capi_cs_test.c.
int test_get_string_status | ( | ) |
Tests fmi1_capi_get_string_status.
Definition at line 375 of file fmi1_capi_cs_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 395 of file fmi1_capi_cs_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 440 of file fmi1_capi_cs_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 485 of file fmi1_capi_cs_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 530 of file fmi1_capi_cs_test.c.
int test_reset_slave | ( | ) |
Tests fmi1_capi_reset_slave.
Definition at line 575 of file fmi1_capi_cs_test.c.
int test_set_real_input_derivatives | ( | ) |
Tests fmi1_capi_set_real_input_derivatives fmi1_capi_set_real_input_derivatives returns fmiError if wrong values are set. The values that are set are tested inside the DLL.
Definition at line 592 of file fmi1_capi_cs_test.c.
int test_get_real_output_derivatives | ( | ) |
Tests fmi1_capi_get_real_output_derivatives The output values from fmi1_capi_get_real_output_derivatives is expected to have a special value that is coded in the DLL.
Definition at line 623 of file fmi1_capi_cs_test.c.
int test_terminate_slave | ( | ) |
Tests fmi1_capi_terminate_slave.
Definition at line 670 of file fmi1_capi_cs_test.c.
int test_free_slave_instance | ( | ) |
Tests fmi1_capi_free_slave_instance.
Definition at line 687 of file fmi1_capi_cs_test.c.
int test_free_dll | ( | ) |
Tests fmi1_capi_free_dll.
Definition at line 698 of file fmi1_capi_cs_test.c.
int test_destroy_dllfmu | ( | ) |
Tests fmi1_capi_destroy_dllfmu.
Definition at line 709 of file fmi1_capi_cs_test.c.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Tests the C-API for FMI 1.0 Co-Simulation. 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 721 of file fmi1_capi_cs_test.c.
fmi1_capi_t* fmu |
Definition at line 37 of file fmi1_capi_cs_test.c.
jm_callbacks* callbacks = 0 |
Definition at line 67 of file fmi1_capi_cs_test.c.