1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-09-02 15:41:25 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
Bruno Haible
99e8c6b00e sethostname tests: Fix link error on mingw.
* tests/test-sethostname1.c: New file, extracted from
tests/test-sethostname.c.
* tests/test-sethostname2.c: New file, extracted from
tests/test-sethostname.c.
* tests/test-sethostname.c: Remove file.
* modules/sethostname-tests (Files): Add tests/test-sethostname1.c,
tests/test-sethostname2.c. Remove tests/test-sethostname.c.
(Depends-on): Add gethostname.
(Makefile.am): Compile both test-sethostname1 and test-sethostname2.
Link the latter with $(GETHOSTNAME_LIB).
2011-12-03 15:57:00 +01:00
Bruno Haible
91c85981b4 sethostname tests: Fix compilation error on mingw.
* tests/test-sethostname.c: Don't include <sys/types.h>.
(geteuid): Use a dummy value without uid_t.
* modules/sethostname-tests (Depends-on): Remove sys_types.
2011-12-03 15:42:25 +01:00
Bruno Haible
97aaf15f6b Tweak last commit.
* modules/sethostname-tests (Files): Sort by decreasing importance.
(configure.ac): Check for geteuid.
* tests/test-sethostname.c (main): Emit error messages to stderr. Skip
the test when there's nothing to test. Drop an unnecessary cast.
Improve an error message. Verify that the final sethostname() call
succeeds.
2011-12-03 14:50:45 +01:00
Ben Walton
146ac55d8a Add a test suite for the sethostname module.
Provide a module that tests the functionality of sethostname().

* modules/sethostname-tests: New file.  A test program
for the sethostname module.
* tests/test-sethostname.c: Likewise.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
2011-12-03 14:28:31 +01:00