I know the purpose and usage of include guards around the .h file in C++
#ifndef FILENAME_H
#define FILENAME_H
#endif
However, I am trying to understand the usage for #ifdef TEST_FILENAME in the test stub or around the main() method used to test run the class.
#ifdef TEST_FILENAME
void main()
{
/////////////////
}
#endif
It’s probably so that you can have a conditional main function run.
If you’re testing, you’ll want a test routine to run, if not you’ll probably want to execute your actual main function. This allows you define the macro during compile-time so that the preprocessor can give you the right main to build.