selftests/nolibc: add sbrk_0 to test current brk getting
authorZhangjin Wu <falcon@tinylab.org>
Fri, 7 Jul 2023 15:04:38 +0000 (23:04 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 02:38:02 +0000 (04:38 +0200)
commitf193ecbff0effc06190036d92ec2fa582d9e6824
tree461d628ba95313ebdb3821dec086878e0b2e1507
parent29f5540be3925d76ef6257d23b1782cdbf55c94f
selftests/nolibc: add sbrk_0 to test current brk getting

>From musl 0.9.14 (to the latest version 1.2.3), both sbrk() and brk()
have almost been disabled for they conflict with malloc, only sbrk(0) is
still permitted as a way to get the current location of the program
break, let's support such case.

EXPECT_PTRNE() is used to expect sbrk() always successfully getting the
current break.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/testing/selftests/nolibc/nolibc-test.c