From e0e63df44d88b4b6139cd29906df1fd697c4bc4a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 18 Jan 2009 18:35:25 +0100 Subject: [PATCH] Use module progname correctly in the tests that need it. --- ChangeLog | 11 +++++++++++ tests/test-avltree_list.c | 4 +++- tests/test-avltree_oset.c | 4 +++- tests/test-obstack-printf.c | 6 +++++- tests/test-quotearg.c | 8 ++++++-- tests/test-xmemdup0.c | 6 +++++- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9b6b253d9..929dcfc595 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-01-18 Bruno Haible + + * tests/test-avltree_list.c (main): Call set_program_name. + * tests/test-avltree_oset.c (main): Likewise. + * tests/test-obstack-printf.c: Include progname.h. + (main): Call set_program_name. + * tests/test-quotearg.c: Include progname.h. + (main): Call set_program_name. + * tests/test-xmemdup0.c: Include progname.h. + (main): Call set_program_name. + 2009-01-18 Bruno Haible New module 'alphasort'. diff --git a/tests/test-avltree_list.c b/tests/test-avltree_list.c index 59e5d99606..28b97a0e59 100644 --- a/tests/test-avltree_list.c +++ b/tests/test-avltree_list.c @@ -1,5 +1,5 @@ /* Test of sequential list data type implementation. - Copyright (C) 2006-2008 Free Software Foundation, Inc. + Copyright (C) 2006-2009 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -74,6 +74,8 @@ main (int argc, char *argv[]) { gl_list_t list1, list2, list3; + set_program_name (argv[0]); + /* Allow the user to provide a non-default random seed on the command line. */ if (argc > 1) srand (atoi (argv[1])); diff --git a/tests/test-avltree_oset.c b/tests/test-avltree_oset.c index 7af78e0214..3bdf0aa987 100644 --- a/tests/test-avltree_oset.c +++ b/tests/test-avltree_oset.c @@ -1,5 +1,5 @@ /* Test of ordered set data type implementation. - Copyright (C) 2006-2008 Free Software Foundation, Inc. + Copyright (C) 2006-2009 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -84,6 +84,8 @@ main (int argc, char *argv[]) { gl_oset_t set1, set2; + set_program_name (argv[0]); + /* Allow the user to provide a non-default random seed on the command line. */ if (argc > 1) srand (atoi (argv[1])); diff --git a/tests/test-obstack-printf.c b/tests/test-obstack-printf.c index 9c2761a319..0c918d012d 100644 --- a/tests/test-obstack-printf.c +++ b/tests/test-obstack-printf.c @@ -1,5 +1,5 @@ /* Test of obstack_printf() and obstack_vprintf() functions. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-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 @@ -27,6 +27,8 @@ #include #include +#include "progname.h" + #define ASSERT(expr) \ do \ { \ @@ -134,6 +136,8 @@ test_obstack_printf () int main (int argc, char *argv[]) { + set_program_name (argv[0]); + test_obstack_vprintf (); test_obstack_printf (); return 0; diff --git a/tests/test-quotearg.c b/tests/test-quotearg.c index 04de223cd8..f629060014 100644 --- a/tests/test-quotearg.c +++ b/tests/test-quotearg.c @@ -1,5 +1,5 @@ /* Test of quotearg family of functions. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-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 @@ -28,6 +28,8 @@ #include #include +#include "progname.h" + #if ENABLE_NLS /* On Linux, gettext is optionally defined as a forwarding macro, which would cause syntax errors in our definition below. But on @@ -284,10 +286,12 @@ dcgettext (char const *d, char const *str, int c) #endif /* ENABLE_NLS */ int -main () +main (int argc, char *argv[]) { int i; + set_program_name (argv[0]); + /* This program is hard-wired to the C locale since it does not call setlocale. */ ASSERT (!isprint ('\033')); diff --git a/tests/test-xmemdup0.c b/tests/test-xmemdup0.c index 7295cc0710..efefd94a26 100644 --- a/tests/test-xmemdup0.c +++ b/tests/test-xmemdup0.c @@ -1,5 +1,5 @@ /* Test of xmemdup0() function. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-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 @@ -25,6 +25,8 @@ #include #include +#include "progname.h" + #define ASSERT(expr) \ do \ { \ @@ -43,6 +45,8 @@ main (int argc, char **argv) char buffer[10] = { 'a', 'b', 'c', 'd', '\0', 'f', 'g', 'h', 'i', 'j' }; + set_program_name (argv[0]); + /* Empty string. */ { char *result = xmemdup0 (NULL, 0); -- 2.30.2