diff options
| author | jvoisin | 2023-05-30 20:53:31 +0200 |
|---|---|---|
| committer | jvoisin | 2023-05-30 20:53:31 +0200 |
| commit | 37d8733dc522c44f9cdb9247f4a59e23bf0a9659 (patch) | |
| tree | 97207d3e3b3c9f0bb054617f7e2215b4ac990492 /tests | |
| parent | 1ace027335c9ca0ae400958aded936d04505ec86 (diff) | |
Add a test for getcwd
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 1 | ||||
| -rw-r--r-- | tests/test_getcwd.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile index 18f55fe..8eded26 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -15,6 +15,7 @@ TARGETS=test_memcpy_static_write \ | |||
| 15 | test_strcat_static_write \ | 15 | test_strcat_static_write \ |
| 16 | test_strcpy_overwrite_over \ | 16 | test_strcpy_overwrite_over \ |
| 17 | test_strcpy_overwrite_under\ | 17 | test_strcpy_overwrite_under\ |
| 18 | test_getcwd \ | ||
| 18 | 19 | ||
| 19 | .SILENT: | 20 | .SILENT: |
| 20 | 21 | ||
diff --git a/tests/test_getcwd.c b/tests/test_getcwd.c new file mode 100644 index 0000000..14a55fa --- /dev/null +++ b/tests/test_getcwd.c | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[12] = {0}; | ||
| 7 | |||
| 8 | CHK_FAIL_START | ||
| 9 | getcwd(buffer, 14); | ||
| 10 | CHK_FAIL_END | ||
| 11 | |||
| 12 | puts(buffer); | ||
| 13 | return ret; | ||
| 14 | } | ||
