static void tst_res__(const char *file, const int lineno, int ttype, const char *arg_fmt, ...) { pthread_mutex_lock(&tmutex); char tmesg[USERMESG]; int len = 0; int ttype_result = TTYPE_RESULT(ttype); if (file && (ttype_result != TPASS && ttype_result != TINFO)) len = sprintf(tmesg, "%s:%d: ", file, lineno); EXPAND_VAR_ARGS(tmesg + len, arg_fmt, USERMESG - len); /* * Save the test result type by ORing ttype into the current exit * value (used by tst_exit()). */ T_exitval |= ttype_result; if (ttype_result == TPASS) passed_cnt++; check_env(); /* * Set the test case number and print the results, depending on the * display type. */ if (ttype_result == TWARN || ttype_result == TINFO) { tst_print(TCID, 0, ttype, tmesg); } else { if (tst_count < 0) tst_print(TCID, 0, TWARN, "tst_res(): tst_count < 0 is not valid"); /* * Process each display type. */ switch (T_mode) { case DISCARD: break; case NOPASS: /* filtered by tst_print() */ tst_condense(tst_count + 1, ttype, tmesg); break; default: /* VERBOSE */ tst_print(TCID, tst_count + 1, ttype, tmesg); break; } tst_count++; } pthread_mutex_unlock(&tmutex); }
static void tst_res__(const char *file, const int lineno, int ttype, const char *fname, const char *arg_fmt, ...) { pthread_mutex_lock(&tmutex); char tmesg[USERMESG]; int len = 0; int ttype_result = TTYPE_RESULT(ttype); #if DEBUG printf("IN tst_res__; tst_count = %d\n", tst_count); fflush(stdout); #endif if (file && (ttype_result != TPASS && ttype_result != TINFO)) len = sprintf(tmesg, "%s:%d: ", file, lineno); EXPAND_VAR_ARGS(tmesg + len, arg_fmt, USERMESG - len); /* * Save the test result type by ORing ttype into the current exit * value (used by tst_exit()). */ T_exitval |= ttype_result; /* * Unless T_out has already been set by tst_environ(), make tst_res() * output go to standard output. */ if (T_out == NULL) T_out = stdout; /* * Check TOUTPUT environment variable (if first time) and set T_mode * flag. */ check_env(); if (fname != NULL && access(fname, F_OK) == 0) File = fname; /* * Set the test case number and print the results, depending on the * display type. */ if (ttype_result == TWARN || ttype_result == TINFO) { tst_print(TCID, 0, ttype, tmesg); } else { if (tst_count < 0) tst_print(TCID, 0, TWARN, "tst_res(): tst_count < 0 is not valid"); /* * Process each display type. */ switch (T_mode) { case DISCARD: break; case NOPASS: /* filtered by tst_print() */ tst_condense(tst_count + 1, ttype, tmesg); break; default: /* VERBOSE */ tst_print(TCID, tst_count + 1, ttype, tmesg); break; } tst_count++; } pthread_mutex_unlock(&tmutex); }