[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r23043 - Extractor/src/main
From: |
gnunet |
Subject: |
[GNUnet-SVN] r23043 - Extractor/src/main |
Date: |
Thu, 2 Aug 2012 21:59:13 +0200 |
Author: grothoff
Date: 2012-08-02 21:59:13 +0200 (Thu, 02 Aug 2012)
New Revision: 23043
Modified:
Extractor/src/main/extractor_ipc_gnu.c
Extractor/src/main/extractor_plugpath.c
Extractor/src/main/test_ipc.c
Extractor/src/main/test_plugin_load_multi.c
Extractor/src/main/test_plugin_loading.c
Extractor/src/main/test_trivial.c
Log:
-make tests less verbose if they pass, also remove dependency on src/plugins/
Modified: Extractor/src/main/extractor_ipc_gnu.c
===================================================================
--- Extractor/src/main/extractor_ipc_gnu.c 2012-08-02 19:51:29 UTC (rev
23042)
+++ Extractor/src/main/extractor_ipc_gnu.c 2012-08-02 19:59:13 UTC (rev
23043)
@@ -154,9 +154,6 @@
"%slibextractor-shm-%u-%u",
tpath, getpid (),
(unsigned int) RANDOM());
- LOG ("Creating shared memory `%s' with %u bytes capacity\n",
- shm->shm_name,
- (unsigned int) size);
if (-1 == (shm->shm_id = shm_open (shm->shm_name,
O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)))
{
@@ -207,8 +204,6 @@
void
EXTRACTOR_IPC_shared_memory_destroy_ (struct EXTRACTOR_SharedMemory *shm)
{
- LOG ("Destroying shared memory `%s'\n",
- shm->shm_name);
munmap (shm->shm_ptr, shm->shm_size);
(void) close (shm->shm_id);
(void) shm_unlink (shm->shm_name);
Modified: Extractor/src/main/extractor_plugpath.c
===================================================================
--- Extractor/src/main/extractor_plugpath.c 2012-08-02 19:51:29 UTC (rev
23042)
+++ Extractor/src/main/extractor_plugpath.c 2012-08-02 19:59:13 UTC (rev
23043)
@@ -501,7 +501,6 @@
struct SearchContext *sc = cls;
DIR *dir;
struct dirent *ent;
- const char *la;
const char *sym_name;
char *sym;
char *dot;
@@ -514,12 +513,8 @@
{
if ('.' == ent->d_name[0])
continue;
- if ( ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
- ('\0' == la[3]) ) ||
- ( (NULL != (la = strstr (ent->d_name, ".ver"))) &&
- (la[4] == '\0') ) ||
- ( (NULL != (la = strstr (ent->d_name, ".a"))) &&
- (la[2] == '\0') ) )
+ if ( (NULL == strstr (ent->d_name, ".so")) &&
+ (NULL == strstr (ent->d_name, ".dll")) )
continue; /* only load '.so' and '.dll' */
if (NULL == (sym_name = strrchr (ent->d_name, '_')))
continue;
@@ -592,7 +587,6 @@
struct DefaultLoaderContext *dlc = cls;
DIR *dir;
struct dirent *ent;
- const char *la;
const char *sym_name;
char *sym;
char *dot;
@@ -603,14 +597,9 @@
{
if (ent->d_name[0] == '.')
continue;
- if ( ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
- (la[3] == '\0') ) ||
- ( (NULL != (la = strstr (ent->d_name, ".ver"))) &&
- (la[4] == '\0') ) ||
- ( (NULL != (la = strstr (ent->d_name, ".a"))) &&
- (la[2] == '\0')) )
+ if ( (NULL == strstr (ent->d_name, ".so")) &&
+ (NULL == strstr (ent->d_name, ".dll")) )
continue; /* only load '.so' and '.dll' */
-
if (NULL == (sym_name = strrchr (ent->d_name, '_')))
continue;
sym_name++;
@@ -622,8 +611,6 @@
}
if (NULL != (dot = strchr (sym, '.')))
*dot = '\0';
- LOG ("Adding default plugin `%s'\n",
- sym);
dlc->res = EXTRACTOR_plugin_add (dlc->res,
sym,
NULL,
Modified: Extractor/src/main/test_ipc.c
===================================================================
--- Extractor/src/main/test_ipc.c 2012-08-02 19:51:29 UTC (rev 23042)
+++ Extractor/src/main/test_ipc.c 2012-08-02 19:59:13 UTC (rev 23043)
@@ -96,7 +96,9 @@
HLO,
strlen (HLO))) )
{
+#if 0
fprintf (stderr, "Received '%s'\n", HLO);
+#endif
ret = 1;
return 0;
}
@@ -106,7 +108,9 @@
GOB,
strlen (GOB))) )
{
+#if 0
fprintf (stderr, "Received '%s'\n", GOB);
+#endif
ret = 0;
return 1;
}
Modified: Extractor/src/main/test_plugin_load_multi.c
===================================================================
--- Extractor/src/main/test_plugin_load_multi.c 2012-08-02 19:51:29 UTC (rev
23042)
+++ Extractor/src/main/test_plugin_load_multi.c 2012-08-02 19:59:13 UTC (rev
23043)
@@ -57,6 +57,13 @@
{
int ret = 0;
+ /* change environment to find 'extractor_test' plugin which is
+ not installed but should be in the current directory (or .libs)
+ on 'make check' */
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ fprintf (stderr,
+ "Failed to update my environment, plugin loading may fail: %s\n",
+ strerror (errno));
ret += testLoadPlugins ();
ret += testLoadPlugins ();
return ret;
Modified: Extractor/src/main/test_plugin_loading.c
===================================================================
--- Extractor/src/main/test_plugin_loading.c 2012-08-02 19:51:29 UTC (rev
23042)
+++ Extractor/src/main/test_plugin_loading.c 2012-08-02 19:59:13 UTC (rev
23043)
@@ -30,25 +30,22 @@
{
struct EXTRACTOR_PluginList *arg;
+ /* change environment to find 'extractor_test' plugin which is
+ not installed but should be in the current directory (or .libs)
+ on 'make check' */
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ fprintf (stderr,
+ "Failed to update my environment, plugin loading may fail: %s\n",
+ strerror (errno));
+
/* do some load/unload tests */
- arg = EXTRACTOR_plugin_add (NULL, "mime", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_add (arg, "png", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_add (arg, "zip", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_remove (arg, "mime");
- arg = EXTRACTOR_plugin_remove (arg, "zip");
- arg = EXTRACTOR_plugin_remove (arg, "png");
- if (NULL != arg)
+ arg = EXTRACTOR_plugin_add (NULL, "test", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
+ if (arg != EXTRACTOR_plugin_add (arg, "test", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY))
{
fprintf (stderr,
- "add-remove test failed!\n");
- return -1;
+ "Could load plugin twice, that should not be allowed\n");
}
- arg = EXTRACTOR_plugin_add (NULL, "mime", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_add (arg, "png", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_add (arg, "zip", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
- arg = EXTRACTOR_plugin_remove (arg, "zip");
- arg = EXTRACTOR_plugin_remove (arg, "mime");
- arg = EXTRACTOR_plugin_remove (arg, "png");
+ arg = EXTRACTOR_plugin_remove (arg, "test");
if (NULL != arg)
{
fprintf (stderr,
Modified: Extractor/src/main/test_trivial.c
===================================================================
--- Extractor/src/main/test_trivial.c 2012-08-02 19:51:29 UTC (rev 23042)
+++ Extractor/src/main/test_trivial.c 2012-08-02 19:59:13 UTC (rev 23043)
@@ -46,6 +46,14 @@
{
int ret = 0;
+
+ /* change environment to find 'extractor_test' plugin which is
+ not installed but should be in the current directory (or .libs)
+ on 'make check' */
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ fprintf (stderr,
+ "Failed to update my environment, plugin loading may fail: %s\n",
+ strerror (errno));
ret += testLoadPlugins (EXTRACTOR_OPTION_DEFAULT_POLICY);
ret += testLoadPlugins (EXTRACTOR_OPTION_DEFAULT_POLICY);
ret += testLoadPlugins (EXTRACTOR_OPTION_DEFAULT_POLICY);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r23043 - Extractor/src/main,
gnunet <=