سؤال

i have the following code in my unit tests:

#ifndef SERVER_TEST
    NSLog(@"\n\n!!!--- YOU ARE RUNNING TESTS IN STUB MODE ---!!!\n\n!!!--- Server Responses will be stubbed ---!!!\n\n");
#else
    NSLog(@"\n\n!!!--- YOU ARE RUNNING TESTS IN LIVE MODE ---!!!\n\n!!!--- Server Responses will be live ---!!!\n\n");
#endif

SERVER_TEST is defined under Build Settings in my Test target's User Defined Settings.

When I run my tests, #ifndef SERVER_TEST always returns True. Any ideas why?

Thanks?

هل كانت مفيدة؟

المحلول

You should keep this flag as Preprocessor macro instead of User Defined Settings.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top