Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2011-12-28 05:11:37 -0500
committerThomas Schuetz2011-12-28 05:11:37 -0500
commit24ed21d2aa4e3767be47119d8a02441274e7480a (patch)
tree94605b771af0fef0c8f6cda65ac45cafb1ac04e4
parent6883e25c985d76bc574169cad7a206a9b466edb0 (diff)
downloadorg.eclipse.etrice-24ed21d2aa4e3767be47119d8a02441274e7480a.tar.gz
org.eclipse.etrice-24ed21d2aa4e3767be47119d8a02441274e7480a.tar.xz
org.eclipse.etrice-24ed21d2aa4e3767be47119d8a02441274e7480a.zip
[generator.c.reference] reference project for development of c-generator
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.cproject139
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.gitignore2
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.project77
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.codan.core.prefs66
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs22
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/manualCGenLaunch.launch13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room174
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/report.xml9
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/DataClass.h17
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c44
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.c112
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.h72
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src/runtime/datatypes.h40
13 files changed, 787 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.cproject b/examples/org.eclipse.etrice.generator.c.reference/.cproject
new file mode 100644
index 000000000..bf8fcd9f5
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/.cproject
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.54263550">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.54263550" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.54263550" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.54263550." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.918285240" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1377401325" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.generator.c.reference/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1914462916" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.2128193487" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
+ <option id="gnu.both.asm.option.include.paths.646571697" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath"/>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1636502349" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1852443642" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1864486752" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.321169512" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1151544407" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1547425303" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.836528711" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.1206340557" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.937550345" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/runtime}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.215126527" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2141539090" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
+ <option id="gnu.c.link.option.libs.1886054812" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs"/>
+ <option id="gnu.c.link.option.paths.1410926104" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1941302758" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1915798937" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ <entry excluding="src|src-gen" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src-gen"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.505530637" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.1445732435">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.1445732435" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.release.1445732435" name="Release" parent="cdt.managedbuild.config.gnu.mingw.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.1445732435." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.release.44614125" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.release">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.release.1563670810" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.release"/>
+ <builder buildPath="${workspace_loc:/org.eclipse.etrice.generator.c.reference/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.748437960" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release.2087319745" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release">
+ <option id="gnu.both.asm.option.include.paths.2089558096" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1375308303" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.245787891" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1042972525" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release">
+ <option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.1950851559" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.373334651" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1378403430" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.554911279" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.331396171" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.include.paths.1226733508" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.156681579" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.1192709765" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release">
+ <option id="gnu.c.link.option.libs.2121552378" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs"/>
+ <option id="gnu.c.link.option.paths.1610581119" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1107454825" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1557729682" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src-gen"/>
+ <entry excluding="src|src-gen" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.release.406040144" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/Release"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c"/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="org.eclipse.etrice.generator.c.reference.cdt.managedbuild.target.gnu.mingw.exe.44532741" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.54263550;cdt.managedbuild.config.gnu.mingw.exe.debug.54263550.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1547425303;cdt.managedbuild.tool.gnu.c.compiler.input.215126527">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.1445732435;cdt.managedbuild.config.gnu.mingw.exe.release.1445732435.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1378403430;cdt.managedbuild.tool.gnu.c.compiler.input.156681579">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="refreshScope" versionNumber="1">
+ <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.generator.c.reference"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cproject>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.gitignore b/examples/org.eclipse.etrice.generator.c.reference/.gitignore
new file mode 100644
index 000000000..0f3a6b1b9
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/.gitignore
@@ -0,0 +1,2 @@
+Debug
+Release
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.project b/examples/org.eclipse.etrice.generator.c.reference/.project
new file mode 100644
index 000000000..bb068e0ab
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/.project
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.generator.c.reference</name>
+ <comment></comment>
+ <projects>
+ <project>org.eclipse.etrice.runtime.c</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/org.eclipse.etrice.generator.c.reference/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.codan.core.prefs b/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.codan.core.prefs
new file mode 100644
index 000000000..9f5f4e439
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.codan.core.prefs
@@ -0,0 +1,66 @@
+#Mon Dec 26 18:56:09 CET 2011
+eclipse.preferences.version=1
+org.eclipse.cdt.codan.checkers.errnoreturn=Warning
+org.eclipse.cdt.codan.checkers.errnoreturn.params={implicit\=>false}
+org.eclipse.cdt.codan.checkers.errreturnvalue=Error
+org.eclipse.cdt.codan.checkers.errreturnvalue.params={}
+org.eclipse.cdt.codan.checkers.noreturn=Error
+org.eclipse.cdt.codan.checkers.noreturn.params={implicit\=>false}
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={}
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={}
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false}
+org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
+org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={unknown\=>false,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={}
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={}
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={}
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={paramNot\=>false}
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={else\=>false,afterelse\=>false}
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={macro\=>true,exceptions\=>("@(\#)","$Id")}
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs
new file mode 100644
index 000000000..dea3bcaa0
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/.settings/org.eclipse.cdt.managedbuilder.core.prefs
@@ -0,0 +1,22 @@
+#Tue Dec 27 19:24:40 CET 2011
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/CPATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/C_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/appendContributed=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/CPATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/C_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/appendContributed=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/LIBRARY_PATH/delimiter=;
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/LIBRARY_PATH/operation=remove
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/append=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.54263550/appendContributed=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/LIBRARY_PATH/delimiter=;
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/LIBRARY_PATH/operation=remove
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/append=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1445732435/appendContributed=true
diff --git a/examples/org.eclipse.etrice.generator.c.reference/manualCGenLaunch.launch b/examples/org.eclipse.etrice.generator.c.reference/manualCGenLaunch.launch
new file mode 100644
index 000000000..cb2203d2c
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/manualCGenLaunch.launch
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.etrice.generator.c.Main"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:org.eclipse.etrice.generator.c.reference}\model\cGenRef.room"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.c"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room b/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room
new file mode 100644
index 000000000..4b285f88a
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/model/cGenRef.room
@@ -0,0 +1,174 @@
+RoomModel cGenRef {
+
+ DataClass DataClass1 {
+ usercode1 {"// usercode1"}
+ usercode2 {"// usercode2"}
+ usercode3 {"// usercode3"}
+ Attribute Attr1: int32
+ Attribute ComplexAttr: DataClass2
+ Attribute Attr3: float32
+
+ Operation MultiplyWithAttr1(value: int32): int32 {
+ "return self->Attr1*value;"
+ }
+ Operation MultiplyWithAttr3(value: float32): float32 {
+ "return self->Attr3*value;"
+ }
+ }
+
+ DataClass DataClass2 {
+ Attribute Attr1: int32
+ Attribute Attr2: float32
+ Attribute Attr3: int32
+ Operation Operation1(): void {"/*nothing to do*/"}
+ }
+
+ SubSystemClass SS {
+ ActorRef Receiver: Receiver
+ ActorRef Sender: Sender
+ ActorRef Broadcast: Broadcast
+ ActorRef Receiver2: Receiver
+ ActorRef ref0: Broadcast
+ ActorRef ref1: Broadcast
+ ActorRef ref2: Receiver
+ ActorRef ref3: Receiver
+ Binding Sender.dataOut and Broadcast.dataIn
+ Binding Broadcast.dataOut and ref0.dataIn
+ Binding Broadcast.dataOut and ref1.dataIn
+ Binding Receiver.dataIn and ref0.dataOut
+ Binding Receiver2.dataIn and ref0.dataOut
+ Binding ref2.dataIn and ref1.dataOut
+ Binding ref3.dataIn and ref1.dataOut
+ }
+
+ ActorClass Receiver {
+ Interface {
+ Port dataIn: CommunicationProtocol
+ }
+ Structure {
+ external Port dataIn
+ Attribute attr1: DataClass1
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Idle { }
+ Transition tr0: Idle -> DataReceived {
+ triggers {
+ <sendData: dataIn>
+ }
+ action {
+ "dataIn.receivedData();"
+ }
+ }
+ State Idle
+ State DataReceived
+ }
+ }
+ }
+
+ ActorClass Broadcast {
+ Interface {
+ Port dataIn: CommunicationProtocol
+ conjugated Port dataOut [2]: CommunicationProtocol
+ }
+ Structure {
+ external Port dataIn
+ external Port dataOut
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Idle { }
+ Transition tr0: Idle -> tp0 of Sending {
+ triggers {
+ <sendData: dataIn>
+ }
+ action {
+ "//dataOut.get(0).sendData(data);"
+ "//dataOut.get(1).sendData(data);"
+ "dataOut.sendData(data);"
+ }
+ }
+ Transition tr1: tp1 of Sending -> ReceivedBoth {
+ action {
+ "dataIn.receivedData();"
+ }
+ }
+ State Idle
+ State Sending {
+ subgraph {
+ Transition tr0: my tp0 -> WaitingForReceived
+ Transition tr1: WaitingForReceived -> ReceivedOne {
+ triggers {
+ <receivedData: dataOut guard {
+ "true"
+ }>
+ }
+ }
+ Transition tr2: WaitingForReceived -> ReceivedTheOther {
+ triggers {
+ <receivedData: dataOut guard {
+ "false"
+ }>
+ }
+ }
+ Transition tr3: ReceivedOne -> my tp1 {
+ triggers {
+ <receivedData: dataOut guard {
+ "true"
+ }>
+ }
+ }
+ Transition tr4: ReceivedTheOther -> my tp1 {
+ triggers {
+ <receivedData: dataOut guard {
+ "false"
+ }>
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State WaitingForReceived
+ State ReceivedOne
+ State ReceivedTheOther
+ }
+ }
+ State ReceivedBoth
+ }
+ }
+ }
+
+ ActorClass Sender {
+ Interface {
+ conjugated Port dataOut: CommunicationProtocol
+ }
+ Structure {
+ external Port dataOut
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> SendingData { }
+ Transition tr0: SendingData -> Done {
+ triggers {
+ <receivedData: dataOut>
+ }
+ }
+ State SendingData {
+ entry {
+ "dataOut.sendData(1234);"
+ }
+ }
+ State Done
+ }
+ }
+ }
+
+ ProtocolClass CommunicationProtocol {
+ incoming {
+ Message sendData(data: int32)
+ }
+ outgoing {
+ Message receivedData()
+ }
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.generator.c.reference/report.xml b/examples/org.eclipse.etrice.generator.c.reference/report.xml
new file mode 100644
index 000000000..72be9bcea
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/report.xml
@@ -0,0 +1,9 @@
+<testsuite name="testGeneratedDataClass" tests="0" failures="0" errors="0" time="0">
+ <testcase name="Attr1" classname="none" time="0.0000"/>
+ <testcase name="ComplexAttr.Attr1" classname="none" time="0.0000"/>
+ <testcase name="ComplexAttr.Attr2" classname="none" time="0.0000"/>
+ <testcase name="ComplexAttr.Attr3" classname="none" time="0.0000"/>
+ <testcase name="Attr3" classname="none" time="0.0000"/>
+ <testcase name="Operation DataClass1_MultiplyWithAttr1" classname="none" time="0.0000"/>
+ <testcase name="Operation DataClass1_MultiplyWithAttr3" classname="none" time="0.0000"/>
+</testsuite>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/DataClass.h b/examples/org.eclipse.etrice.generator.c.reference/src/DataClass.h
new file mode 100644
index 000000000..196481c0e
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/DataClass.h
@@ -0,0 +1,17 @@
+/*
+ * DataClass.h
+ *
+ * Created on: 22.12.2011
+ * Author: tschuetz
+ */
+
+#ifndef DATACLASS_H_
+#define DATACLASS_H_
+
+
+
+struct DataClass {
+ int att1;
+};
+
+#endif /* DATACLASS_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c b/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c
new file mode 100644
index 000000000..72b9f8564
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/SSRunner.c
@@ -0,0 +1,44 @@
+/*
+ * SSRunner.c
+ *
+ * Created on: 21.12.2011
+ * Author: tschuetz
+ */
+
+#include <stdio.h>
+#include "../src-gen/cGenRef/DataClass1.h"
+#include "RUnit.h"
+
+void testDataClassDeepCopy(void);
+
+
+int main(void){
+ testDataClassDeepCopy();
+ return 0;
+}
+
+void testDataClassDeepCopy(void){
+ RUnit_open("testGeneratedDataClass");
+
+ DataClass1 d, e;
+ d.Attr1 = 123;
+ d.ComplexAttr.Attr1 = 456;
+ d.ComplexAttr.Attr2 = 789.123;
+ d.ComplexAttr.Attr3 = 789;
+ d.Attr3 = 321.123;
+
+ DataClass1_deepCopy(&d,&e);
+
+ EXPECT_EQUAL_INT("Attr1", 123, e.Attr1);
+ EXPECT_EQUAL_INT("ComplexAttr.Attr1", 456, e.ComplexAttr.Attr1);
+ EXPECT_EQUAL_FLOAT("ComplexAttr.Attr2", 789.123, e.ComplexAttr.Attr2);
+ EXPECT_EQUAL_INT("ComplexAttr.Attr3", 789, e.ComplexAttr.Attr3);
+ EXPECT_EQUAL_FLOAT("Attr3", 321.123, e.Attr3);
+
+ EXPECT_EQUAL_INT("Operation DataClass1_MultiplyWithAttr1", 246, DataClass1_MultiplyWithAttr1(&d, 2));
+ EXPECT_EQUAL_FLOAT("Operation DataClass1_MultiplyWithAttr3", 642.246, DataClass1_MultiplyWithAttr3(&d, 2));
+
+ RUnit_close();
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.c b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.c
new file mode 100644
index 000000000..655e84d43
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.c
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "RUnit.h"
+
+
+void RUnit_open(const char *testSuiteName) {
+ RUnit_passCount = 0;
+ RUnit_failCount = 0;
+ printf("************* TEST START **************\n");
+
+ if (RUnit_reportfile == NULL) {
+ RUnit_reportfile = fopen("report.xml", "w+");
+ if (RUnit_reportfile != NULL) {
+ fprintf(
+ RUnit_reportfile,
+ "<testsuite name=\"%s\" tests=\"0\" failures=\"0\" errors=\"0\" time=\"0\">\n",
+ testSuiteName);
+ } else {
+ printf("Unable to open file!");
+ }
+ }
+ // prepare time measurement
+ RUnit_startTime = clock();
+ RUnit_currentTime = clock();
+ printf("Start Time: %ld\n", RUnit_startTime);
+
+}
+ void RUnit_close(void) {
+
+ printf("\n");
+ if (RUnit_failCount > 0) {
+ printf("************* TEST FAILED *************\n");
+ } else {
+ printf("************* TEST PASSED *************\n");
+ }
+ printf("Number of Tests: %ld\n", RUnit_failCount + RUnit_passCount);
+ printf("Failed: %ld\n", RUnit_failCount);
+ printf("Passed: %ld\n", RUnit_passCount);
+ printf("Total Time: %ld\n", clock() - RUnit_startTime);
+ printf("End Time: %ld, CLOCKS_PER_SEC: %ld\n", clock(), CLOCKS_PER_SEC);
+ printf("***************************************\n");
+
+
+
+ if (RUnit_reportfile != NULL) {
+ fprintf(RUnit_reportfile, "</testsuite>\n");
+ fclose(RUnit_reportfile);
+ RUnit_reportfile = NULL;
+ }
+
+}
+
+void EXPECT_TRUE(const char* testcase, boool condition) {
+ if (condition == FALSE) {
+ RUnit_writeTestLog(testcase, FALSE, "*** FAIL: EXPECT_TRUE == FALSE");
+ } else {
+ RUnit_writeTestLog(testcase, TRUE, "");
+ }
+}
+
+void EXPECT_FALSE(const char* testcase, boool condition) {
+ if (condition == TRUE) {
+ RUnit_writeTestLog(testcase, FALSE, "*** FAIL: EXPECT_FALSE == TRUE");
+ } else {
+ RUnit_writeTestLog(testcase, FALSE, "");
+ }
+}
+
+//_________
+
+void RUnit_buildTestLogXML(char* xml, const char *testcase, boool result, const char *resulttext, clock_t time) {
+ if (result == TRUE) {
+ sprintf(xml, "\t<testcase name=\"%s\" classname=\"none\" time=\"0.0000\"/>\n", testcase);
+ } else {
+ sprintf(xml, "\t<testcase name=\"%s\" classname=\"none\" time=\"0.0000\">\n\t\t<failure message=\"%s\" type=\"\"/>\n\t</testcase>\n", testcase, resulttext);
+ }
+}
+
+void RUnit_writeTestLog(const char *testcase, boool result, const char *resulttext) {
+ char writeBuffer[256]; // TODO TS: write secure buffers for string handling ...
+
+
+ // counting
+ if (result == TRUE) {
+ RUnit_passCount++;
+ printf("PASS: %s: %s\n", testcase, resulttext);
+ }
+ else {
+ RUnit_failCount++;
+ printf("FAIL: %s: %s\n", testcase, resulttext);
+ }
+
+ clock_t time = clock()-RUnit_currentTime;
+ RUnit_currentTime = clock();
+
+ // writing to file
+ if (RUnit_reportfile != NULL) {
+ RUnit_buildTestLogXML(writeBuffer, testcase, result, resulttext, time);
+ fprintf(RUnit_reportfile, writeBuffer);
+ }
+}
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.h b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.h
new file mode 100644
index 000000000..f0f865f2e
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/RUnit.h
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _RUNIT_H_
+#define _RUNIT_H_
+
+#include "datatypes.h"
+#include <stdio.h>
+#include <time.h>
+
+//*** global variables
+// file handling
+static FILE* RUnit_reportfile = NULL;
+
+// counters
+static int32 RUnit_passCount = 0;
+static int32 RUnit_failCount = 0;
+
+// time measuring
+static clock_t RUnit_startTime = 0;
+static clock_t RUnit_currentTime = 0;
+
+
+// forward declarations
+void RUnit_open(const char *testSuiteName);
+void RUnit_close(void);
+void RUnit_writeTestLog(const char *testcase, boool result, const char *resulttext);
+
+
+void EXPECT_TRUE(const char* testcase, boool condition);
+void EXPECT_FALSE(const char* testcase, boool condition);
+
+//void EXPECT_EQUAL(const char* testcase, int8 expected, int8 actual);
+//void EXPECT_EQUAL(const char* testcase, int16 expected, int16 actual);
+//void EXPECT_EQUAL(const char* testcase, int32 expected, int32 actual);
+//void EXPECT_EQUAL(const char* testcase, uint8 expected, uint8 actual);
+//void EXPECT_EQUAL(const char* testcase, uint16 expected, uint16 actual);
+//void EXPECT_EQUAL(const char* testcase, uint32 expected, uint32 actual);
+
+
+#define EXPECT_EQUAL_INT(testcase, expected, actual) \
+ if (expected != actual) { \
+ char testresult[256]; \
+ sprintf(testresult, "expected=%ld, actual=%ld", expected, actual); \
+ RUnit_writeTestLog(testcase, FALSE, testresult); \
+ } \
+ else { \
+ RUnit_writeTestLog(testcase, TRUE, ""); \
+ }
+
+#define FLOAT_PRECISION 0.0001
+
+#define EXPECT_EQUAL_FLOAT(testcase, expected, actual) \
+ if (expected-actual < -FLOAT_PRECISION || expected-actual > FLOAT_PRECISION) { \
+ char testresult[256]; \
+ sprintf(testresult, "expected=%f, actual=%f", expected, actual); \
+ RUnit_writeTestLog(testcase, FALSE, testresult); \
+ } \
+ else { \
+ RUnit_writeTestLog(testcase, TRUE, ""); \
+ }
+
+#endif /* _RUNIT_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src/runtime/datatypes.h b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/datatypes.h
new file mode 100644
index 000000000..ff97c8489
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src/runtime/datatypes.h
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _DATATYPES_H_
+#define _DATATYPES_H_
+
+/* unsigned integer datatypes */
+typedef unsigned char uint8;
+typedef unsigned short int uint16;
+typedef unsigned long uint32;
+
+/* signed integer datatypes */
+typedef char int8;
+typedef short int int16;
+typedef long int32;
+
+/* float datatypes */
+typedef float float32;
+typedef double float64;
+
+/* boolean datatypes and values */
+typedef char boool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
+#ifndef TRUE
+ #define TRUE 1
+#endif
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+
+#endif /* _DATATYPES_H_ */

Back to the top