Frequently Asked Question

C-CODE: How can I reuse my C-Code testframe and compare it with other
Last Updated 3 months ago

Sometimes the same testcases need to be executed with the C\C++-platform and another platform like the MATLAB-platform. In such cases the issue of different datatype structures or signal names may occur. In one platform the variables may be in a struct in another platform the signals may be primitives. 

For such cases mappings need to be used. In the C\C++-platform the renaming flavor can be used by simply setting the external name to the name that would originally be imported. To explain this further let's look at the attached example. The variable structVar with the elements a,b and c shall be used with another platform that has the variables a,b and c directly. 

To create an appropriate mapping open the declaration editor with Ctrl+D and click the button in the screenshot below.


Use the green button in the mapping dialog to create a new Mapping and select the Rename flavor in the right column. In the example this mapping is called "StructToPrimitives". Afterwards the new mapping can be selected and the column "External_Name" appears in the declaration editor. 


In this column the names in the other platform can be entered. 

 After this is done this mapping can be selected in another C-platform to map the variables from TPT to the other SUT.


After this is done the same testcases can be executed with a platform that uses different names. Some platforms have better support for this renamings, therefore it is recommended to use the renaming in the C\C++-platform and use the original interface in the other platform. To try this, you can just select an appropriate compiler in those platforms, regenerate the testframes and execute the testcase.

Please Wait!

Please wait... it will take a second!