Skip to content
Snippets Groups Projects
Commit 18e1a560 authored by Graham MacDonald's avatar Graham MacDonald
Browse files

Re-enable netdb tests, fix compiler warning, improve brk coverage

parent a3f7a174
No related branches found
No related tags found
No related merge requests found
......@@ -16,10 +16,13 @@ EXPECT_NAMES=\
libgen \
locale \
math \
netdb/getaddrinfo \
netdb/netdb \
ptrace \
regex \
select \
setjmp \
signal \
stdio/all \
stdio/buffer \
stdio/fgets \
......@@ -98,11 +101,7 @@ EXPECT_NAMES=\
wchar/wcsstr \
wchar/wcstod \
wchar/wcstok \
wchar/wcstol \
signal
# TODO: Fix these
# netdb/getaddrinfo \
# netdb/netdb \
wchar/wcstol
# Binaries that may generate varied output
NAMES=\
......
IPv4 address: 23.21.162.66 (www.redox-os.org)
No visible errors occurred!
......@@ -5,10 +5,22 @@
#include "test_helpers.h"
int main(void) {
// sbrk report current brk
void * current = sbrk(0);
ERROR_IF(sbrk, current, == (void *)-1);
int status = brk(current + 4096);
// sbrk increment and report previous brk
void * prev = current;
current = sbrk(4096);
ERROR_IF(sbrk, current, != prev);
// sbrk report current break
prev = current;
current = sbrk(0);
ERROR_IF(sbrk, current, != (void*)((uintptr_t)prev + 4096));
// brk set break to new value
int status = brk((void*)((uintptr_t)current + 4096));
ERROR_IF(brk, status, == -1);
UNEXP_IF(brk, status, != 0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment