diff options
author | David Robillard <d@drobilla.net> | 2022-08-18 16:44:41 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-18 16:44:41 -0400 |
commit | b9d58f74ea1d072e7a2d1c862dc7a1e0fe5fccb0 (patch) | |
tree | 9b01f7f6e96af405457cba746ca85dd21d38a3e5 /test/test_strerror.c | |
parent | 9ac3f4e009fd0d393d2c41449b121498e5b7ad54 (diff) | |
download | zix-b9d58f74ea1d072e7a2d1c862dc7a1e0fe5fccb0.tar.gz zix-b9d58f74ea1d072e7a2d1c862dc7a1e0fe5fccb0.tar.bz2 zix-b9d58f74ea1d072e7a2d1c862dc7a1e0fe5fccb0.zip |
Factor out converting errno codes to ZixStatus
Diffstat (limited to 'test/test_strerror.c')
-rw-r--r-- | test/test_strerror.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/test/test_strerror.c b/test/test_strerror.c deleted file mode 100644 index 2f4c090..0000000 --- a/test/test_strerror.c +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021 David Robillard <d@drobilla.net> -// SPDX-License-Identifier: ISC - -#undef NDEBUG - -#include "zix/common.h" - -#include <assert.h> -#include <stdio.h> -#include <string.h> - -int -main(void) -{ - const char* msg = zix_strerror(ZIX_STATUS_SUCCESS); - assert(!strcmp(msg, "Success")); - - for (int i = ZIX_STATUS_ERROR; i <= ZIX_STATUS_REACHED_END; ++i) { - msg = zix_strerror((ZixStatus)i); - assert(strcmp(msg, "Success")); - } - - msg = zix_strerror((ZixStatus)-1); - assert(!strcmp(msg, "Unknown error")); - - msg = zix_strerror((ZixStatus)1000000); - assert(!strcmp(msg, "Unknown error")); - - printf("Success\n"); - return 0; -} |