Hello Vla
Where did you define UNIT_TEST? Usually we define the macro in Project Properties-> C/C++ Build-> Settings-> HCS08 Compiler -> Preprocessor, please see the screenshot below.
Please remove it from this panel if you do not need it in release reversion of your software.

It is easy to know the macro exists, just place some illegal code inside the “#ifdef…… #endif”. If the macro definition is already removed completely, there should be no error like below. If the error appears, there must be somewhere defined the macro.

If your variables or functions defined inside “#ifdef…… #endif” are not appearing in the new generated MAP file, they should not be included in S-record file either. Please compare the S-record files to know what is changed before and after removing the macro definition.
Hope it helps!
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------