]> git.proxmox.com Git - mirror_corosync.git/commitdiff
TEST: remove unused code.
authorAngus Salkeld <asalkeld@redhat.com>
Mon, 13 Feb 2012 10:45:29 +0000 (21:45 +1100)
committerAngus Salkeld <asalkeld@redhat.com>
Tue, 14 Feb 2012 00:10:14 +0000 (11:10 +1100)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
test/sa_error.c [deleted file]
test/sa_error.h [deleted file]

diff --git a/test/sa_error.c b/test/sa_error.c
deleted file mode 100644 (file)
index 61924c7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include <config.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "saAis.h"
-
-const char *sa_error_list[] = {
-       "OUT_OF_RANGE",
-       "CS_OK",
-       "CS_ERR_LIBRARY",
-       "CS_ERR_VERSION",
-       "CS_ERR_INIT",
-       "CS_ERR_TIMEOUT",
-       "CS_ERR_TRY_AGAIN",
-       "CS_ERR_INVALID_PARAM",
-       "CS_ERR_NO_MEMORY",
-       "CS_ERR_BAD_HANDLE",
-       "CS_ERR_BUSY",
-       "CS_ERR_ACCESS",
-       "CS_ERR_NOT_EXIST",
-       "CS_ERR_NAME_TOO_LONG",
-       "CS_ERR_EXIST",
-       "CS_ERR_NO_SPACE",
-       "CS_ERR_INTERRUPT",
-       "CS_ERR_NAME_NOT_FOUND",
-       "CS_ERR_NO_RESOURCES",
-       "CS_ERR_NOT_SUPPORTED",
-       "CS_ERR_BAD_OPERATION",
-       "CS_ERR_FAILED_OPERATION",
-       "CS_ERR_MESSAGE_ERROR",
-       "CS_ERR_QUEUE_FULL",
-       "CS_ERR_QUEUE_NOT_AVAILABLE",
-       "CS_ERR_BAD_CHECKPOINT",
-       "CS_ERR_BAD_FLAGS",
-       "CS_ERR_NO_SECTIONS",
-};
-
-int get_sa_error(cs_error_t error, char *str, int len)
-{
-       if (error < CS_OK ||
-                       error > CS_ERR_NO_SECTIONS ||
-                                       len < strlen(sa_error_list[error])) {
-                       errno = EINVAL;
-               return -1;
-       }
-       strncpy(str, sa_error_list[error], len);
-       if (len > 0) {
-               str[len - 1] = '\0';
-       }
-       return 0;
-}
-
-char *get_sa_error_b (cs_error_t error) {
-       return ((char *)sa_error_list[error]);
-}
-
-char *get_test_output (cs_error_t result, cs_error_t expected) {
-static char test_result[256];
-
-        if (result == expected) {
-                return ("PASSED");
-        } else {
-                snprintf (test_result, sizeof(test_result),
-                        "FAILED expected %s got %s",
-                       get_sa_error_b(expected), get_sa_error_b(result));
-                return (test_result);
-        }
-}
diff --git a/test/sa_error.h b/test/sa_error.h
deleted file mode 100644 (file)
index f8114b3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-extern int get_sa_error(cs_error_t error, char *str, int len);
-
-extern char *get_sa_error_b (cs_error_t error);
-
-extern char *get_test_output (cs_error_t result, cs_error_t expected);