# HG changeset patch # User Simon Josefsson # Date 1232359137 -3600 # Node ID 7bc989ad4d9a9911d07bde498fdc4fde48b9bf3d # Parent e073cd7459e8453f85651b894a069f20c089ceff fstrcmp-tests and filenamecat-tests: Use progname module. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-01-18 Simon Josefsson + + * modules/filenamecat-tests (Depends-on): Add progname. + * modules/fstrcmp-tests (Depends-on): Likewise. + + * tests/test-filenamecat.c: Use progname module, to avoid link + errors on non-glibc systems. + * tests/test-fstrcmp.c: Likewise. + 2009-01-19 Daniel P. Berrange gettimeofday: avoid warning: nested extern declaration of 'localtime' diff --git a/modules/filenamecat-tests b/modules/filenamecat-tests --- a/modules/filenamecat-tests +++ b/modules/filenamecat-tests @@ -3,6 +3,7 @@ Depends-on: stdbool +progname configure.ac: diff --git a/modules/fstrcmp-tests b/modules/fstrcmp-tests --- a/modules/fstrcmp-tests +++ b/modules/fstrcmp-tests @@ -3,6 +3,7 @@ Depends-on: stdbool +progname configure.ac: diff --git a/tests/test-filenamecat.c b/tests/test-filenamecat.c --- a/tests/test-filenamecat.c +++ b/tests/test-filenamecat.c @@ -1,6 +1,6 @@ /* Test of concatenation of two arbitrary file names. - Copyright (C) 1996-2007 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +26,10 @@ #include #include +#include "progname.h" + int -main () +main (int argc, char *argv[]) { static char const *const tests[][3] = { @@ -46,6 +48,9 @@ }; unsigned int i; bool fail = false; + + set_program_name (argv[0]); + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { char *base_in_result; diff --git a/tests/test-fstrcmp.c b/tests/test-fstrcmp.c --- a/tests/test-fstrcmp.c +++ b/tests/test-fstrcmp.c @@ -1,5 +1,5 @@ /* Test of fuzzy string comparison. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,8 @@ #include #include +#include "progname.h" + #define ASSERT(expr) \ do \ { \ @@ -75,8 +77,10 @@ } int -main () +main (int argc, char *argv[]) { + set_program_name (argv[0]); + ASSERT (check_fstrcmp ("Langstrumpf", "Langstrumpf", 1.0)); ASSERT (check_fstrcmp ("Levenshtein", "Levenstein", 20./21.)); ASSERT (check_fstrcmp ("Levenstein", "Levenshtein", 20./21.));