Commit Graph

239 Commits

Author SHA1 Message Date
jD91mZM2 269b8a1d3e Merge branch 'cleanup' into 'master'
tests: Macro based error handling

See merge request redox-os/relibc!195
2019-03-03 15:19:19 +00:00
lmiskiew 5eb2a8f7bd Implement swab 2019-02-28 08:23:11 +00:00
jD91mZM2 30a0f70d73 Merge branch 'wcsrchr' into 'master'
implements wcsrchr from wchar.h

See merge request redox-os/relibc!197
2019-02-28 08:21:55 +00:00
jD91mZM2 fe905ed13c Merge branch 'calloc_overflow_check' into 'master'
add calloc integer overflow check

See merge request redox-os/relibc!188
2019-02-28 08:20:11 +00:00
emturner 4ed6dca61d implements wcsrchr from wchar.h 2019-02-25 22:53:11 +00:00
Tibor Nagy fa2c6d29db tests: Rewrite libgen tests based on ctype (nice table layout), fix error handling of sleep tests 2019-02-25 19:32:20 +01:00
Tibor Nagy efd6947d8e tests: Fix function-like macros
Turns the results of these macros from compound to regular statements using the old `do { ... } while(0)` trick. Must have for function-like macros.
2019-02-25 14:13:02 +01:00
Tibor Nagy 96182ce8ad tests: Fix expected outputs 2019-02-24 22:19:07 +01:00
Tibor Nagy a92be000fb tests: Even more work on error handling
realpath: Fixing undefined behaviour in the second test. If the call fails the resolved_name argument cannot be used for error checking because its state is undefined by SUSv2.
pipe: Changing the order of close and write error handling code. Errors in close could overwrite errno after write errors, returning incorrect error messages.
gmtime: Removed duplicate checks
Other fixes for fseek, rename, mktime, putwchar
2019-02-24 22:02:11 +01:00
Tibor Nagy 2d027f0771 tests: More work on error handling 2019-02-24 00:46:26 +01:00
emturner ec3488c7b0 implements wcscspn from wchar.h 2019-02-22 23:18:21 +00:00
Tibor Nagy 0c539d6e4e tests: Fix expected outputs 2019-02-22 13:28:18 +01:00
Tibor Nagy 513f4ba53c tests: Documentation for test_helpers.h, more refactoring 2019-02-22 13:19:38 +01:00
Tibor Nagy 9a0ea6ff34 tests: More refactoring, add helper header to every test, override exit for better error reporting 2019-02-21 21:13:28 +01:00
Tibor Nagy 6266d29242 tests: Fix expected outputs 2019-02-21 17:46:18 +01:00
Tibor Nagy 64acf45c40 tests: Add helper macros for easier error handling and reporting 2019-02-21 17:35:24 +01:00
Tibor Nagy f60c95d2ca tests: Work on more thorough error handling 2019-02-21 16:15:49 +01:00
Tibor Nagy d1a424c002 tests: Replace returns with exits in the main functions
This will allow us to redefine the exit function.

For example:
```
#define exit(code) { \
    fprintf(stderr, "%s:%d: exit(%s) in function ‘%s’\n",
        __FILE__, __LINE__, #code, __func__); \
    _exit(code); \
}
```
2019-02-21 12:15:06 +01:00
Tibor Nagy 4381bb2a22 tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
2019-02-20 21:09:03 +01:00
Tibor Nagy c19cc8b731 tests: Portability fixes, replaced 0/1/-1 return codes with macros 2019-02-20 20:20:07 +01:00
Tibor Nagy ff874c87d7 tests: Fix function signatures 2019-02-20 19:27:18 +01:00
Tibor Nagy 7ee59d2fdb tests: set C11, enable pedantic warnings, fix GCC and Clang warnings 2019-02-20 15:04:47 +01:00
Tibor Nagy 1eb22b2cb2 ctype: Add tests for toascii, tolower, toupper 2019-02-19 20:54:05 +01:00
Tibor Nagy 5fac72298f ctype: Fix iscntrl, isgraph, ispunct, make tests exhaustive
iscntrl: Didn't handle the EOF macro correctly
isgraph: Didn't handle '~' (tilde) correctly
ispunct: Several issues
2019-02-19 19:53:54 +01:00
Peter Limkilde Svendsen 7aa0fbdf93 Include stdint.h in test 2019-02-02 16:51:38 +01:00
Peter Limkilde Svendsen 8b7453edf2 Add test of calloc with overflow 2019-02-02 16:41:09 +01:00
Jeremy Soller 602f015e93 Implement fpathconf and pathconf 2019-01-27 18:53:57 -07:00
Jeremy Soller c59f268fcd Implement getaddrinfo (somewhat) 2019-01-21 20:36:56 -07:00
Jeremy Soller 8e9d65cb46 Add support for pthreads to Linux 2019-01-13 14:17:29 -07:00
Jeremy Soller 434cad49ce Add sysconf 2019-01-13 14:16:51 -07:00
lmiskiew 5b6b11cb65 Fix panic in fwrite 2018-12-17 02:01:36 +01:00
Jeremy Soller a8f3608f3c Fix stdlib div functions, add _Exit 2018-12-14 13:41:22 -07:00
Jeremy Soller 594bcd75d4 Add closedir to dirent test 2018-12-02 13:20:33 -07:00
Jeremy Soller 9325183b21 Fix strcat 2018-12-01 08:55:02 -07:00
Jeremy Soller 950b4526c7 - Disable output of empty header files
- Remove incorrect header styles
- Use export.replace where header style was previously needed
- Check compilation of tests using system gcc
2018-11-26 21:35:02 -07:00
Jeremy Soller 52493a1ec3 Add popen/pclose 2018-11-25 10:33:50 -07:00
Jeremy Soller de43271204 Merge branch 'uname' into 'master'
Implement uname for Redox

See merge request redox-os/relibc!178
2018-11-25 15:25:48 +00:00
Tibor Nagy 55eb8f2779 Implement alloca.h 2018-11-23 21:31:09 +01:00
Tibor Nagy 012a9b2eb3 Implement uname for Redox 2018-11-18 18:23:47 +01:00
jD91mZM2 1c92751a73 Don't rely on integer wrapping in ctype
Don't rely on integer wrapping in ctype and fix strcasecmp on
non-alphabetic characters
2018-11-17 20:26:43 +01:00
Michal Z a7b71a311d Implement libgen.h
Implemented the following calls according to http://pubs.opengroup.org/onlinepubs/7908799/xsh/libgen.h.html
- char* basename(char*)
- char* dirname(char*)

Added test suit for the implemented calls.

Issue: https://gitlab.redox-os.org/redox-os/relibc/issues/134
2018-11-05 17:49:14 +01:00
Tibor Nagy e7f251fdb0 Fix assert when used as an expression
Based on what musl does.
2018-10-27 17:40:24 +02:00
jD91mZM2 bfa068df88 Fix strcasecmp return value 2018-10-17 21:26:16 +02:00
Jeremy Soller 3c2121d4e0 Do not require prefix for hex 2018-10-16 18:03:21 -06:00
jD91mZM2 75c5c04bee Implement a proper mutex type for future usage 2018-10-15 15:24:14 +02:00
jD91mZM2 23fe526c55 Fix feof and ferror 2018-10-14 15:57:42 +02:00
jD91mZM2 edb95246d4 Fix bug in strncasecmp 2018-10-13 16:55:21 +02:00
jD91mZM2 63882684b2 Implement almost all of printf 2018-10-13 14:20:54 +02:00
jD91mZM2 b517629371 Fix timeradd
wow i am stupid for writing this code
2018-10-11 19:52:54 +02:00
Tibor Nagy aee3f68117 Add tests for constructors and destructors 2018-10-09 20:32:27 +02:00