Frequently Asked Question

C-CODE: How can I test functions with pointer arguments in cases of NULL arguments?
Last Updated about a month ago

TPT offers the options to connect the function argument in C as value and as address.
If it is connected as value the NULL cannot be used as argument. To work around this issue, some wrapper code needs to be added.

The C/C++ Platform offers the section ‘Custom Wrapper Code’. The way to call the function with NULL is to write a special function and calling it with NULL there.

Custom WrapperCode to call the Function "callFunction(int* argument)" with NULL: 

void tpt_callFunctionNull()
{
   callFunction((int*)0);
}

A whole example is attached. 

Please Wait!

Please wait... it will take a second!