getcwd: enhance tests
authorEric Blake <eblake@redhat.com>
Tue, 26 Apr 2011 20:51:24 +0000 (14:51 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 27 Apr 2011 17:58:00 +0000 (11:58 -0600)
commit02923aada23a2fa2122b415f313730f2e5e266ec
treefb419a124d615ec5085e4f1a4c47a43cdbf8381b
parent043be67acb94a724f96e3b18c3a09aefffd463af
getcwd: enhance tests

The existing getcwd was weak, and only tested things guaranteed
by the new getcwd-lgpl.  Move those tests into a new file and
strengthen them slightly (such as guaranteeing the ERANGE error
for a non-zero but too-small size).  Then copy the m4 tests
for PATH_MAX failures into the GPL getcwd tests, to prove that
our replacement really is fixing the things that cause us to
reject the system getcwd as non-robust.

* tests/test-getcwd-lgpl.c: New file, taken from...
* tests/test-getcwd.c: ...old contents.  Rewrite this file to
repeat long path stress tests from m4 probe.
* modules/getcwd-lgpl-tests: New module.
* modules/getcwd-tests (Depends-on): Depend on lgpl tests.
* m4/getcwd-abort-bug.m4: Update comment.
* m4/getcwd-path-max.m4: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
m4/getcwd-abort-bug.m4
m4/getcwd-path-max.m4
modules/getcwd-lgpl-tests [new file with mode: 0644]
modules/getcwd-tests
tests/test-getcwd-lgpl.c [new file with mode: 0644]
tests/test-getcwd.c