Skip to content
Snippets Groups Projects
Commit 480036f8 authored by Timur Safin's avatar Timur Safin Committed by Vladimir Davydov
Browse files

test: make xmalloc.test tap-compatible

Part of #7618

NO_DOC=internal
NO_CHANGELOG=internal

(cherry picked from commit c573be80)
parent 7794891d
No related branches found
No related tags found
No related merge requests found
#define UNIT_TAP_COMPATIBLE 1
#include "unit.h"
#include "trivia/util.h"
......
*** main ***
1..5
*** test_xmalloc ***
1..1
ok 1 - p != NULL
ok 1 - subtests
*** test_xmalloc: done ***
*** test_xcalloc ***
1..2
ok 1 - p != NULL
ok 2 - p is zeroed
ok 2 - subtests
*** test_xcalloc: done ***
*** test_xrealloc ***
1..3
ok 1 - p != NULL on alloc
ok 2 - p != NULL on realloc
ok 3 - p is same after realloc
ok 3 - subtests
*** test_xrealloc: done ***
*** test_xstrdup ***
1..3
ok 1 - s != NULL
ok 2 - copy != NULL
ok 3 - strcmp(s, copy) == 0
ok 4 - subtests
*** test_xstrdup: done ***
*** test_xstrndup ***
1..6
ok 1 - s != NULL
ok 2 - copy != NULL
ok 3 - strlen(copy) == n
ok 4 - strncmp(s, copy, n) == 0
ok 5 - strncmp(s, copy, n + 1) > 0
ok 6 - strcmp(s, copy) > 0
ok 5 - subtests
*** test_xstrndup: done ***
*** main: done ***
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