GTEST_FATAL_FAILURE_("tc failed"); \
if (ch == 'r' || ch == 'R') \
goto retry; \
- } else { \
- usleep(1000000); /* 1000 ms */ \
} \
} while (0)
+#define TDM_UT_ASK_YN(fmt, ...) \
+ do { \
+ if (enable_porting_debug) { \
+ char ch; \
+ printf(fmt" [Y]es, [n]o: ", ##__VA_ARGS__); \
+ do { \
+ ch = getchar(); \
+ if (ch == '\n') \
+ ch = 'y'; \
+ else { \
+ char tch; \
+ while ((tch = getchar()) != '\n' && tch != EOF); \
+ } \
+ } while (ch != 'y' && ch != 'Y' && ch != 'n' && ch != 'N'); \
+ if (ch == 'n' || ch == 'N') \
+ GTEST_FATAL_FAILURE_("tc failed"); \
+ } \
+ } while (0)
+
#define TDM_UT_SIZE_ALIGN(value, base) (((value) + ((base) - 1)) & ~((base) - 1))
#define TDM_UT_DUMP_DIR "/tmp/tdm_dump"