mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 14:25:06 -05:00
test: drop logging suspension
Instead of selectively suspending logging by redirecting messages to /dev/null, increase the default minimum log severity to FATAL. In the debug mode, all messages are printed.
This commit is contained in:
@@ -43,6 +43,7 @@ TST_Skip(int line)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
LOG_Severity log_severity;
|
||||
char *test_name, *s;
|
||||
int i, seed = 0;
|
||||
struct timeval tv;
|
||||
@@ -55,9 +56,11 @@ main(int argc, char **argv)
|
||||
if (s)
|
||||
test_name = s + 1;
|
||||
|
||||
log_severity = LOGS_FATAL;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-d")) {
|
||||
LOG_SetMinSeverity(LOGS_DEBUG);
|
||||
log_severity = LOGS_DEBUG;
|
||||
} else if (!strcmp(argv[i], "-s") && i + 1 < argc) {
|
||||
seed = atoi(argv[++i]);
|
||||
} else {
|
||||
@@ -73,6 +76,7 @@ main(int argc, char **argv)
|
||||
fflush(stdout);
|
||||
|
||||
LOG_Initialise();
|
||||
LOG_SetMinSeverity(log_severity);
|
||||
|
||||
test_unit();
|
||||
|
||||
@@ -83,16 +87,6 @@ main(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TST_SuspendLogging(void)
|
||||
{
|
||||
LOG_OpenFileLog("/dev/null");
|
||||
}
|
||||
|
||||
void TST_ResumeLogging(void)
|
||||
{
|
||||
LOG_OpenFileLog(NULL);
|
||||
}
|
||||
|
||||
double
|
||||
TST_GetRandomDouble(double min, double max)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user