From a00e68d5486a9382988a1ca25c52a305c8a020bf Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 29 Jul 2024 19:52:43 +0200 Subject: Build tests with -pedantic Reviewed-by: dogma --- test/unit/cookies.c | 4 ++-- test/unit/unicode_test.cc | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/unit/cookies.c b/test/unit/cookies.c index 923f5227..ce122ffc 100644 --- a/test/unit/cookies.c +++ b/test/unit/cookies.c @@ -277,12 +277,12 @@ static int Dpi_check_dpid(int num_tries) static int Dpi_blocking_start_dpid(void) { int cst, try = 0, - n_tries = 12; /* 3 seconds */ + n_tries = 3; /* 3 seconds */ /* test the dpid, and wait a bit for it to start if necessary */ while ((cst = Dpi_check_dpid(n_tries)) == 1) { MSG("Dpi_blocking_start_dpid: try %d\n", ++try); - usleep(250000); /* 1/4 sec */ + sleep(1); /* 1/4 sec */ } return cst; } diff --git a/test/unit/unicode_test.cc b/test/unit/unicode_test.cc index 0824cdd0..ffcc1627 100644 --- a/test/unit/unicode_test.cc +++ b/test/unit/unicode_test.cc @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) // not 0-terminated; copy from 0-terminated int t2len = strlen (t1); - char t2[t2len]; + char *t2 = new char[t2len]; for (int i = 0; i < t2len; i++) t2[i] = t1[i]; @@ -54,5 +54,7 @@ int main (int argc, char *argv[]) printf ("%3d -> U+%04x\n", (int)(s - t2), decodeUtf8(s, t2len - (s - t2))); + delete[] t2; + return 0; } -- cgit v1.2.3