From 7c58425f9acac9202ef0993b91fe5bd35af03635 Mon Sep 17 00:00:00 2001 From: Scott Fennell Date: Thu, 28 Apr 2022 12:22:21 -0500 Subject: [PATCH] #1258 add sim compile test for anonymous enum (#1259) --- test/SIM_anon_enum/RUN_test/input.py | 5 +++++ test/SIM_anon_enum/S_define | 21 +++++++++++++++++++++ test/SIM_anon_enum/S_overrides.mk | 3 +++ test/SIM_anon_enum/models/starter.cpp | 5 +++++ test/SIM_anon_enum/models/starter.h | 14 ++++++++++++++ test/makefile | 1 + 6 files changed, 49 insertions(+) create mode 100644 test/SIM_anon_enum/RUN_test/input.py create mode 100644 test/SIM_anon_enum/S_define create mode 100644 test/SIM_anon_enum/S_overrides.mk create mode 100644 test/SIM_anon_enum/models/starter.cpp create mode 100644 test/SIM_anon_enum/models/starter.h diff --git a/test/SIM_anon_enum/RUN_test/input.py b/test/SIM_anon_enum/RUN_test/input.py new file mode 100644 index 00000000..3a84eb07 --- /dev/null +++ b/test/SIM_anon_enum/RUN_test/input.py @@ -0,0 +1,5 @@ + + +trick.stop(15.0); +trick.real_time_enable() +trick.sim_control_panel_set_enabled(True) \ No newline at end of file diff --git a/test/SIM_anon_enum/S_define b/test/SIM_anon_enum/S_define new file mode 100644 index 00000000..588c9f89 --- /dev/null +++ b/test/SIM_anon_enum/S_define @@ -0,0 +1,21 @@ +/************************TRICK HEADER************************* +PURPOSE: + () +LIBRARY DEPENDENCIES: +*************************************************************/ + +#include "sim_objects/default_trick_sys.sm" + +##include "starter.h" + +class StarterSimObject : public Trick::SimObject { + + public: + Starter starter; + + StarterSimObject() { + + } +}; + +StarterSimObject starterSimObject; diff --git a/test/SIM_anon_enum/S_overrides.mk b/test/SIM_anon_enum/S_overrides.mk new file mode 100644 index 00000000..6ca9ea96 --- /dev/null +++ b/test/SIM_anon_enum/S_overrides.mk @@ -0,0 +1,3 @@ + +TRICK_CFLAGS += -I./models +TRICK_CXXFLAGS += -I./models diff --git a/test/SIM_anon_enum/models/starter.cpp b/test/SIM_anon_enum/models/starter.cpp new file mode 100644 index 00000000..60da96a3 --- /dev/null +++ b/test/SIM_anon_enum/models/starter.cpp @@ -0,0 +1,5 @@ +#include "starter.h" + +Starter::Starter() { + +} diff --git a/test/SIM_anon_enum/models/starter.h b/test/SIM_anon_enum/models/starter.h new file mode 100644 index 00000000..17342fe1 --- /dev/null +++ b/test/SIM_anon_enum/models/starter.h @@ -0,0 +1,14 @@ +/************************************************************************* +PURPOSE: (Starter class) +LIBRARY DEPENDENCY: + ( + (starter.cpp) + ) +**************************************************************************/ + +class Starter { +public: + Starter(); + public: + enum {VAR = 6}; +}; diff --git a/test/makefile b/test/makefile index abeb9742..61b0b2ca 100644 --- a/test/makefile +++ b/test/makefile @@ -7,6 +7,7 @@ unexport TRICK_PYTHON_PATH SIMS_TO_COMPILE_ONLY = \ SIM_alloc_test \ + SIM_anon_enum \ SIM_default_member_initializer \ SIM_delete_default_constructor \ SIM_demo_inputfile \