Commit graph

153 commits

Author SHA1 Message Date
Thomas Veerman
a209c3ae12 Fix a ton of compiler warnings
This patch fixes most of current reasons to generate compiler warnings.
The changes consist of:
 - adding missing casts
 - hiding or unhiding function declarations
 - including headers where missing
 - add __UNCONST when assigning a const char * to a char *
 - adding missing return statements
 - changing some types from unsigned to signed, as the code seems to want
   signed ints
 - converting old-style function definitions to current style (i.e.,
   void func(param1, param2) short param1, param2; {...} to
   void func (short param1, short param2) {...})
 - making the compiler silent about signed vs unsigned comparisons. We
   have too many of those in the new libc to fix.

A number of bugs in the test set were fixed. These bugs were never
triggered with our old libc. Consequently, these tests are now forced to
link with the new libc or they will generate errors (in particular tests 43
and 55).

Most changes in NetBSD libc are limited to moving aroudn "#ifndef __minix"
or stuff related to Minix-specific things (code in sys-minix or gen/minix).
2011-11-14 10:07:49 +00:00
David van Moolenbroek
a80eb6545a blocktest: add system.conf file, too 2011-11-07 18:26:16 +01:00
David van Moolenbroek
2602861f23 Move optset.c into libsys; remove redundant copies 2011-11-07 16:16:08 +01:00
David van Moolenbroek
fc34180cca Add "blocktest" test, for testing block drivers
The test is located in test/blocktest. It requires hand-editing of
its configuration, and is not part of any automated test set.
2011-11-07 14:55:55 +01:00
Antoine LECA
de346b24e8 fix compile of test23 2011-10-06 18:54:08 +00:00
Thomas Veerman
8a266a478e Increase gid_t and uid_t to 32 bits
Increase gid_t and uid_t to 32 bits and provide backwards compatibility
where needed.
2011-09-05 13:56:14 +00:00
Thomas Veerman
27a2afc1e7 Clean up tests and do runtime test for max name length
- Remove unused code
- Use standard functions declared in common.c
- Change tests to do a runtime test for the max name length of a path
  component (aka NAME_MAX). The actual value might differ from the hard
  coded NAME_MAX depending on the file system used.
2011-08-26 13:16:16 +00:00
Ben Gras
65de5d71a9 test set build fixes for clang/gcc 2011-08-15 16:07:21 +00:00
Thomas Veerman
9b43de2cb3 Clean up mthread 2011-07-27 09:30:26 +00:00
Arun Thomas
6d1095db1e test: define NETBSD_SOURCE for gcc/clang 2011-07-26 16:52:43 +02:00
Arun Thomas
3b08b34ceb Fix test2.sh
-strings is now found in /usr/pkg/bin
2011-07-26 13:50:57 +02:00
Thomas Veerman
ea1971bd21 Forgot to rename mmap to minix_mmap 2011-07-22 10:15:47 +00:00
Evgeniy Ivanov
255ae85b1e Fix time modification on truncate()
POSIX truncate specification says "Upon successful completion, if
the *file size is changed*, this function shall mark for update the
st_ctime and st_mtime fields of the file." This patch prevents
changing of the date fields when the size stays the same.
2011-07-15 14:21:05 +00:00
Ben Gras
a4ac03c188 libm: add i387/ dir, fix test51 compilation
. if $MACHINE_ARCH is unknown, use $MACHINE like in libc
	. fixes test51 compilation for gcc/clang (with other compile
	  and link fixes)
2011-07-08 16:34:40 +02:00
Thomas Cort
66b369c62c opendir(3): on success, don't clobber errno
The opendir(3) function was setting errno to ENOTDIR even
when the directory existed and was opened successfully. This
caused git to falsely detect an error.

This change moves the errno assignment into the failure code
block. It also adds a test to test24 to check for errno
changing when opendir(3) returns success.
2011-06-29 19:58:41 +02:00
Thomas Veerman
22049c1ec3 Enable generation of .gitignore file for the test dir 2011-04-21 13:20:13 +00:00
Thomas Veerman
827daf1fca Make test40 behave
Make test40 behave better. It should create its own subdirectory to
conduct its tests and should not write to /tmp. Also, the master-slave
terminal pair it tries to open might be in use; it should try to obtain
another pair. These changes allow the test to be run multiple times
simultaneously from different paths (to test select() more intensively).
2011-04-21 13:18:00 +00:00
David van Moolenbroek
020277a38f libmthread: support for thread-local storage (keys/specifics) 2011-04-14 11:54:43 +00:00
Thomas Veerman
b1a60476c0 Return errors directly instead of using errno 2011-04-13 14:01:13 +00:00
Thomas Veerman
c8d0edc06a - Refactor mthread structure fields to prevent name clashes
- Remove sanity checks for initialized mutexes and condition variables. This
  significantly boosts performance. The checks can be turned back on by
  compiling libmthread with MTHREAD_STRICT. According to POSIX operations on
  uninitialized variables are a MAY fail if, therefore allowing this
  optimization.
- Test59 has to be accommodated to the lack of sanity checks on uninitialized
  variables in the library. It specifically tests for them and will run into
  segfaults when the checks are absent in the library.
- Fix a few bugs related to the scheduler
- Do some general code cleanups
2011-03-18 10:29:54 +00:00
Thomas Veerman
ba8af817fc Fix compilation error. Does not need ansi.h header. 2011-03-10 14:10:16 +00:00
Arun Thomas
4c0cc2719e Allow for overriding GCC var in test Makefile 2010-11-19 10:33:26 +00:00
Thomas Veerman
a7072a5e1c Revamp the mthread library and update test59
Before, the 'main thread' of a process was never taken into account anywhere in
the library, causing mutexes not to work properly (and consequently, neither
did the condition variables). For example, if the 'main thread' (that is, the
thread which is started at the beginning of a process; not a spawned thread by
the library) would lock a mutex, it wasn't actually locked.
2010-09-30 13:44:13 +00:00
Thomas Veerman
12e167f672 Add libmthread and test59 to test the implementation 2010-09-21 12:22:38 +00:00
David van Moolenbroek
d299a6422b make all other commands use ProcFS 2010-09-14 21:31:56 +00:00
Thomas Veerman
e7252adc1e Clean up the created temp file after running the test. 2010-09-02 09:33:37 +00:00
Thomas Veerman
0b00cf70b6 - Return ENOENT when trying to add files to removed (but open) directories.
- Add test58 to test this behavior.
2010-09-01 09:07:18 +00:00
Thomas Veerman
a4c30acd9d Improve UDS testing. Fix a few bugs. Add testing of passing file descriptors.
Contributed by Thomas Cort.
2010-08-30 13:49:49 +00:00
Arun Thomas
de231a713e Move MIN() and MAX() macros to sys/params.h 2010-08-21 13:10:41 +00:00
Arun Thomas
9a21d1a2fd Macros for symbols used in both ASM and C
-The macros take care of prepending the leading underscore when
 necessary.
2010-08-17 16:44:07 +00:00
Erik van der Kouwe
4e95b347a7 Make it possible again to compile the tests without installing GCC first 2010-08-09 05:51:01 +00:00
Erik van der Kouwe
c8f70b8154 Fix tests when run as root; use bin account but current directory 2010-08-06 12:33:32 +00:00
Erik van der Kouwe
c3c97e66b1 Fix ar error in testsh1.sh (ar was previously renamed to aal) 2010-08-06 09:28:26 +00:00
Erik van der Kouwe
5d4ef90b2c Fix cdiff error in testsh1.sh 2010-08-06 09:27:49 +00:00
Erik van der Kouwe
a9d31d3169 Remove spurious space 2010-08-05 13:35:41 +00:00
Thomas Veerman
e8846c3930 Also run test56, please 2010-08-04 10:03:50 +00:00
Ben Gras
83fc90c8c3 test57: test that state isn't corrupted after a signal handler being executed. 2010-08-04 09:00:58 +00:00
Ben Gras
e1dc59bd16 test Makefile: use any gcc in path 2010-08-03 11:20:31 +00:00
Thomas Veerman
253b4b3fe5 - Add support for ST_NOTRUNC to struct statvfs.
- Let tests that test for long file names check for that flag, so that they can
  verify the results properly.
2010-08-02 11:16:32 +00:00
Thomas Veerman
d26290a017 Add test56 to test our UDS implementation. Contributed by Thomas Cort 2010-07-15 14:52:29 +00:00
Ben Gras
8b0dbff312 test44: suid root to call getsysinfo 2010-07-13 18:27:42 +00:00
Ben Gras
835232d504 tests: fixes to accomodate growing OPEN_MAX and a logic error 2010-07-13 12:38:58 +00:00
Ben Gras
78ce6f86f7 tests: turn of optimisation when compiling the tests, less unexpected optimisations. 2010-07-12 16:22:05 +00:00
Ben Gras
b4345d7598 test44: add bogus getsysinfo() to test invalid memory range request to vm
test case contributed by Roman Ignatov.
2010-07-10 00:24:43 +00:00
Kees van Reeuwijk
0cfdb11450 Repair errors and warnings flagged by llvm. 2010-07-06 11:29:23 +00:00
Arun Thomas
1f20814fe8 Fix grep test 4 in testsh1 2010-06-27 10:59:14 +00:00
Ben Gras
762665cec1 some prettification for test55. 2010-06-24 00:27:26 +00:00
Ben Gras
e3354a8556 test 55 for statvfs. fix formatting bug in test54. 2010-06-24 00:06:40 +00:00
Ben Gras
f2c3cbab00 test for pwrite() (Contributed by Buccapatnam Tirumala, Gautam) 2010-06-22 22:07:23 +00:00
Tomas Hruby
21725c107d cd subdir && $(MAKE) targets -> $(MAKE) -C subdir targets
- first step towards parallel building
2010-06-22 12:03:09 +00:00