From 5c09c1c47ebde9dd9de149244408a356b791ba5c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 7 Sep 2021 13:46:37 +0100 Subject: [PATCH] testsc: remove log_discard(). It was introduced in error by commit d8fda3b6da78c5a: I had originally intended to do test runs of prime generation by means of running every attempt with logging enabled, and after each failed attempt, deleting the log file and restarting it. But that was _far_ too slow, so I abandoned that approach, and switched to the alternative method of searching for a prime with logging turned off, and then repeating just the final successful attempt under logging conditions. log_discard() was the 'delete the log file' function intended for use in the first of those strategies. It wasn't actually used in the end, so I need not have committed it - and worse, the comment inside it claiming it _is_ used in prime generation is needlessly confusing! --- testsc.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/testsc.c b/testsc.c index 3ac88233..c9029662 100644 --- a/testsc.c +++ b/testsc.c @@ -203,22 +203,6 @@ void log_end(void) log_to_file(NULL); sfree(last_filename); } -void log_discard(void) -{ - /* - * Discard the most recently generated log file, and rewind the - * index so that its name will be reused by the next attempt. - * - * Used in tests of prime generation, in which only the - * _successful_ attempts need to be side-channel safe: it doesn't - * matter if a failed attempt leaks its data through early - * termination of a checking loop, because all the data it leaked - * will be thrown away anyway. - */ - char *prev_filename = log_filename(test_basename, --test_index); - remove(prev_filename); - sfree(prev_filename); -} static bool test_skipped = false;