summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2018-01-31 13:35:03 +0100
committerCedric Bail <cedric@osg.samsung.com>2018-01-31 11:07:11 -0800
commitb464ffb67943573f4e12b55dea23a1bc2b1c6832 (patch)
treed14f51cb287897ec655b0bc324508a513505bf4c /src/bin
parenta6d0e787e4f8695cd1269a4af716e419c8c40133 (diff)
downloadefl-b464ffb67943573f4e12b55dea23a1bc2b1c6832.tar.gz
evil: remove useless binary tests
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/evil/evil_suite.c19
-rw-r--r--src/bin/evil/evil_test_dlfcn.c79
-rw-r--r--src/bin/evil/evil_test_dlfcn.h8
-rw-r--r--src/bin/evil/evil_test_environment.c178
-rw-r--r--src/bin/evil/evil_test_environment.h8
-rw-r--r--src/bin/evil/evil_test_gettimeofday.c51
-rw-r--r--src/bin/evil/evil_test_gettimeofday.h8
-rw-r--r--src/bin/evil/evil_test_mkstemp.c95
-rw-r--r--src/bin/evil/evil_test_mkstemp.h8
-rw-r--r--src/bin/evil/evil_test_print.c46
-rw-r--r--src/bin/evil/evil_test_print.h8
-rw-r--r--src/bin/evil/evil_test_realpath.c45
-rw-r--r--src/bin/evil/evil_test_realpath.h8
-rw-r--r--src/bin/evil/test_evil.c27
14 files changed, 3 insertions, 585 deletions
diff --git a/src/bin/evil/evil_suite.c b/src/bin/evil/evil_suite.c
index 6202fb4e7f..aa2e7f3cd4 100644
--- a/src/bin/evil/evil_suite.c
+++ b/src/bin/evil/evil_suite.c
@@ -11,13 +11,7 @@
#include "Evil.h"
#include "evil_suite.h"
-#include "evil_test_dlfcn.h"
-#include "evil_test_environment.h"
-#include "evil_test_gettimeofday.h"
-#include "evil_test_mkstemp.h"
#include "evil_test_pipe.h"
-#include "evil_test_print.h"
-#include "evil_test_realpath.h"
#include "evil_test_util.h"
@@ -178,16 +172,9 @@ int
main(void)
{
test tests[] = {
- { "dlfcn ", test_dlfcn },
- { "environment ", test_environment },
- { "gettimeofday", test_gettimeofday },
- { "mkstemp ", test_mkstemp },
- { "pipe ", test_pipe },
- { "print ", test_print },
- { "realpath ", test_realpath },
- { "util ", test_util },
-/* { "memcpy ", test_memcpy }, */
- { NULL, NULL },
+ { "pipe ", test_pipe },
+ { "util ", test_util },
+ { NULL, NULL },
};
suite *s;
int i;
diff --git a/src/bin/evil/evil_test_dlfcn.c b/src/bin/evil/evil_test_dlfcn.c
deleted file mode 100644
index 605f5c4b68..0000000000
--- a/src/bin/evil/evil_test_dlfcn.c
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_dlfcn.h"
-
-
-typedef int (*_evil_init)(void);
-typedef int (*_evil_shutdwon)(void);
-
-
-static int
-test_dlfcn_test_dlopen(void)
-{
- void *handle;
-
- handle = dlopen("libevil-1.dll", 0);
- if (!handle)
- return 0;
-
- if (dlclose(handle))
- return 0;
-
- return 1;
-}
-
-static int
-test_dlfcn_test_dlsym(void)
-{
- void *handle;
- _evil_init sym_init;
- _evil_shutdwon sym_shutdown;
-
- handle = dlopen("libevil-1.dll", 0);
- if (!handle)
- return 0;
-
- sym_init = dlsym(handle, "evil_init");
- if (!sym_init)
- {
- dlclose(handle);
- return 0;
- }
-
- sym_shutdown = dlsym(handle, "evil_shutdown");
- if (!sym_shutdown)
- {
- dlclose(handle);
- return 0;
- }
-
- if (dlclose(handle))
- return 0;
-
- return 1;
-}
-
-static int
-test_dlfcn_tests_run(suite *s)
-{
- int res;
-
- res = test_dlfcn_test_dlopen();
- res &= test_dlfcn_test_dlsym();
-
- return res;
-}
-
-int
-test_dlfcn(suite *s)
-{
-
- return test_dlfcn_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_dlfcn.h b/src/bin/evil/evil_test_dlfcn.h
deleted file mode 100644
index 0c9bce689e..0000000000
--- a/src/bin/evil/evil_test_dlfcn.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_DLFCN_H__
-#define __EVIL_TEST_DLFCN_H__
-
-
-int test_dlfcn(suite *s);
-
-
-#endif /* __EVIL_TEST_DLFCN_H__ */
diff --git a/src/bin/evil/evil_test_environment.c b/src/bin/evil/evil_test_environment.c
deleted file mode 100644
index 0d31b7912a..0000000000
--- a/src/bin/evil/evil_test_environment.c
+++ /dev/null
@@ -1,178 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_environment.h"
-
-
-static int
-test_env_test_setenv_NULL(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", NULL, 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
-
- return val ? 0 : 1;
-}
-
-static int
-test_env_test_setenv_NULL_after_set(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (strcmp(val, "val"))
- return 0;
-
- res = setenv("EVIL_TEST_ENV", NULL, 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
-
- return val ? 0 : 1;
-}
-
-static int
-test_env_test_getenv_one(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (strcmp(val, "val"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_getenv_two(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV1", "val1", 1);
- if (res < 0)
- return 0;
-
- res = setenv("EVIL_TEST_ENV2", "val2", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV1");
- if (!val)
- return 0;
- if (strcmp(val, "val1"))
- return 0;
-
- val = getenv("EVIL_TEST_ENV2");
- if (!val)
- return 0;
-
- if (strcmp(val, "val2"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_getenv_two_swapped(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV1", "val1", 1);
- if (res < 0)
- return 0;
-
- res = setenv("EVIL_TEST_ENV2", "val2", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV2");
- if (!val)
- return 0;
- if (strcmp(val, "val2"))
- return 0;
-
- val = getenv("EVIL_TEST_ENV1");
- if (!val)
- return 0;
-
- if (strcmp(val, "val1"))
- return 0;
-
- return 1;
-}
-
-static int
-test_env_test_unsetenv(void)
-{
- char *val;
- int res;
-
- res = setenv("EVIL_TEST_ENV", "val", 1);
- if (res < 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (!val)
- return 0;
-
- if (unsetenv("EVIL_TEST_ENV") != 0)
- return 0;
-
- val = getenv("EVIL_TEST_ENV");
- if (val)
- return 0;
-
- return 1;
-}
-
-static int
-test_env_tests_run(suite *s)
-{
- int res;
-
- res = test_env_test_setenv_NULL();
- res &= test_env_test_setenv_NULL_after_set();
- res &= test_env_test_getenv_one();
- res &= test_env_test_getenv_two();
- res &= test_env_test_getenv_two_swapped();
- res &= test_env_test_unsetenv();
-
- return res;
-}
-
-int
-test_environment(suite *s)
-{
-
- return test_env_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_environment.h b/src/bin/evil/evil_test_environment.h
deleted file mode 100644
index 763ee401b1..0000000000
--- a/src/bin/evil/evil_test_environment.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_ENVIRONMENT_H__
-#define __EVIL_TEST_ENVIRONMENT_H__
-
-
-int test_environment(suite *s);
-
-
-#endif /* __EVIL_TEST_ENVIRONMENT_H__ */
diff --git a/src/bin/evil/evil_test_gettimeofday.c b/src/bin/evil/evil_test_gettimeofday.c
deleted file mode 100644
index dc9656e83d..0000000000
--- a/src/bin/evil/evil_test_gettimeofday.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <string.h>
-#include <math.h>
-#include <sys/time.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_gettimeofday.h"
-
-static int
-test_time_test_gettimeofday(void)
-{
- struct timeval tp1;
- struct timeval tp2;
- double delta;
-
- gettimeofday (&tp1, NULL);
-
- Sleep(1000);
-
- gettimeofday (&tp2, NULL);
-
- delta = (double)(tp2.tv_sec - tp1.tv_sec) + (double)(tp2.tv_usec - tp1.tv_usec) / 1000000.0;
- if (fabs(delta - 1) > 0.005)
- {
- return 0;
- }
-
- return 1;
-}
-
-static int
-test_time_tests_run(suite *s)
-{
- int res;
-
- res = test_time_test_gettimeofday();
-
- return res;
-}
-
-int
-test_gettimeofday(suite *s)
-{
-
- return test_time_tests_run(s);
-}
diff --git a/src/bin/evil/evil_test_gettimeofday.h b/src/bin/evil/evil_test_gettimeofday.h
deleted file mode 100644
index ad3155b146..0000000000
--- a/src/bin/evil/evil_test_gettimeofday.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_GETTIMEOFDAY_H__
-#define __EVIL_TEST_GETTIMEOFDAY_H__
-
-
-int test_gettimeofday(suite *s);
-
-
-#endif /* __EVIL_TEST_GETTIMEOFDAY_H__ */
diff --git a/src/bin/evil/evil_test_mkstemp.c b/src/bin/evil/evil_test_mkstemp.c
deleted file mode 100644
index 54d9df5d17..0000000000
--- a/src/bin/evil/evil_test_mkstemp.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_mkstemp.h"
-
-
-static int
-test_mkstemp_test(void)
-{
- char _template[PATH_MAX];
-#ifdef _WIN32_WCE
- char cwd[PATH_MAX];
-#endif
- int fd;
-
-#ifdef _WIN32_WCE
- if (!getcwd(cwd, PATH_MAX))
- return 0;
- _snprintf(_template, PATH_MAX, "%s\\%s", cwd, "file_XXXXXX");
-#else
- _snprintf(_template, PATH_MAX, "%s", "file_XXXXXX");
-#endif
-
- fd = mkstemp(_template);
-
- if (fd < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_mkstemps_test(void)
-{
- char _template[PATH_MAX];
-#ifdef _WIN32_WCE
- char cwd[PATH_MAX];
-#endif
- int fd;
-
-#ifdef _WIN32_WCE
- if (!getcwd(cwd, PATH_MAX))
- return 0;
- _snprintf(_template, PATH_MAX, "%s\\%s", cwd, "file_XXXXXX.ext");
-#else
- _snprintf(_template, PATH_MAX, "%s", "file_XXXXXX.ext");
-#endif
-
- fd = mkstemps(_template, 4);
-
- if (fd < 0)
- return 0;
-
- return 1;
-}
-
-static int
-test_mkstemp_run(suite *s)
-{
- int res;
- (void) s;
-
- res = test_mkstemp_test();
-
- return res;
-}
-
-static int
-test_mkstemps_run(suite *s)
-{
- int res;
- (void) s;
-
- res = test_mkstemps_test();
-
- return res;
-}
-
-int
-test_mkstemp(suite *s)
-{
- int res;
-
- res = test_mkstemp_run(s);
- res &= test_mkstemps_run(s);
-
- return res;
-}
diff --git a/src/bin/evil/evil_test_mkstemp.h b/src/bin/evil/evil_test_mkstemp.h
deleted file mode 100644
index f5bb0c4270..0000000000
--- a/src/bin/evil/evil_test_mkstemp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_MKSTEMP_H__
-#define __EVIL_TEST_MKSTEMP_H__
-
-
-int test_mkstemp(suite *s);
-
-
-#endif /* __EVIL_TEST_MKSTEMP_H__ */
diff --git a/src/bin/evil/evil_test_print.c b/src/bin/evil/evil_test_print.c
deleted file mode 100644
index c775cfbefd..0000000000
--- a/src/bin/evil/evil_test_print.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_print.h"
-
-static int
-test_print_test(void)
-{
- char buf[16];
- int i1 = 1;
- size_t i2 = 123456;
- int res;
-
- res = printf("%02hhd\n", i1);
- if (res != 3)
- return 0;
-
- res = snprintf(buf, sizeof(buf), "%zu", i2);
- if (res != 6)
- return 0;
-
- return 1;
-}
-
-static int
-test_print_run(suite *s)
-{
- int res;
-
- res = test_print_test();
-
- return res;
-}
-
-int
-test_print(suite *s)
-{
- return test_print_run(s);
-}
diff --git a/src/bin/evil/evil_test_print.h b/src/bin/evil/evil_test_print.h
deleted file mode 100644
index 2bbf43904f..0000000000
--- a/src/bin/evil/evil_test_print.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_PRINT_H__
-#define __EVIL_TEST_PRINT_H__
-
-
-int test_print(suite *s);
-
-
-#endif /* __EVIL_TEST_PRINT_H__ */
diff --git a/src/bin/evil/evil_test_realpath.c b/src/bin/evil/evil_test_realpath.c
deleted file mode 100644
index fbc4d1d570..0000000000
--- a/src/bin/evil/evil_test_realpath.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <Evil.h>
-
-#include "evil_suite.h"
-#include "evil_test_realpath.h"
-
-
-static int
-test_realpath_test(void)
-{
- char buf[PATH_MAX];
- char *filename;
- char *result;
-
- filename = "evil_suite.exe";
-
- if (!(result = realpath(filename, buf)))
- return 0;
-
- printf ("res : %s\n", buf);
-
- return 1;
-}
-
-static int
-test_realpath_run(suite *s)
-{
- int res;
-
- res = test_realpath_test();
-
- return res;
-}
-
-int
-test_realpath(suite *s)
-{
- return test_realpath_run(s);
-}
diff --git a/src/bin/evil/evil_test_realpath.h b/src/bin/evil/evil_test_realpath.h
deleted file mode 100644
index 0205aad149..0000000000
--- a/src/bin/evil/evil_test_realpath.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __EVIL_TEST_REALPATH_H__
-#define __EVIL_TEST_REALPATH_H__
-
-
-int test_realpath(suite *s);
-
-
-#endif /* __EVIL_TEST_REALPATH_H__ */
diff --git a/src/bin/evil/test_evil.c b/src/bin/evil/test_evil.c
deleted file mode 100644
index 5b91172cb3..0000000000
--- a/src/bin/evil/test_evil.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/time.h>
-
-#include <windows.h>
-
-
-
-int
-main()
-{
- struct timeval tv;
- double t1 = 0.0;
- double t2 = 0.0;
-
- if (gettimeofday(&tv, NULL) == 0)
- t1 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- Sleep(3000);
-
- if (gettimeofday(&tv, NULL) == 0)
- t2 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- printf ("3 seconds ? %f\n", t2 - t1);
-
- return EXIT_SUCCESS;
-}