summaryrefslogtreecommitdiffstats
path: root/test/test_strerror.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 16:44:41 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 16:44:41 -0400
commitb9d58f74ea1d072e7a2d1c862dc7a1e0fe5fccb0 (patch)
tree9b01f7f6e96af405457cba746ca85dd21d38a3e5 /test/test_strerror.c
parent9ac3f4e009fd0d393d2c41449b121498e5b7ad54 (diff)
downloadzix-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.c31
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;
-}