[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22976 - in Extractor/src: main plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22976 - in Extractor/src: main plugins |
Date: |
Mon, 30 Jul 2012 14:59:43 +0200 |
Author: grothoff
Date: 2012-07-30 14:59:43 +0200 (Mon, 30 Jul 2012)
New Revision: 22976
Added:
Extractor/src/plugins/fuzz_default.sh
Extractor/src/plugins/fuzz_thumbnail.sh
Removed:
Extractor/src/main/fuzz_default.sh
Extractor/src/main/fuzz_thumbnail.sh
Modified:
Extractor/src/main/Makefile.am
Extractor/src/main/extractor_plugins.c
Extractor/src/main/test_plugin_load_multi.c
Extractor/src/main/test_plugin_loading.c
Extractor/src/main/test_trivial.c
Extractor/src/plugins/Makefile.am
Log:
misc minor fixes
Modified: Extractor/src/main/Makefile.am
===================================================================
--- Extractor/src/main/Makefile.am 2012-07-30 11:58:01 UTC (rev 22975)
+++ Extractor/src/main/Makefile.am 2012-07-30 12:59:43 UTC (rev 22976)
@@ -58,10 +58,6 @@
LDADD = \
$(top_builddir)/src/main/libextractor.la
-if HAVE_ZZUF
- fuzz_tests=fuzz_default.sh fuzz_thumbnail.sh
-endif
-
TESTS_ENVIRONMENT = testdatadir=$(top_srcdir)/test
TESTS_ENVIRONMENT += bindir=${bindir}
@@ -70,7 +66,7 @@
test_plugin_loading \
test_plugin_load_multi
-TESTS = $(check_PROGRAMS) $(fuzz_tests)
+TESTS = $(check_PROGRAMS)
test_trivial_SOURCES = \
test_trivial.c
Modified: Extractor/src/main/extractor_plugins.c
===================================================================
--- Extractor/src/main/extractor_plugins.c 2012-07-30 11:58:01 UTC (rev
22975)
+++ Extractor/src/main/extractor_plugins.c 2012-07-30 12:59:43 UTC (rev
22976)
@@ -237,6 +237,7 @@
}
if (NULL == (result = malloc (sizeof (struct EXTRACTOR_PluginList))))
return prev;
+ memset (result, 0, sizeof (struct EXTRACTOR_PluginList));
result->next = prev;
if (NULL == (result->short_libname = strdup (library)))
{
Deleted: Extractor/src/main/fuzz_default.sh
===================================================================
--- Extractor/src/main/fuzz_default.sh 2012-07-30 11:58:01 UTC (rev 22975)
+++ Extractor/src/main/fuzz_default.sh 2012-07-30 12:59:43 UTC (rev 22976)
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-ZZSTARTSEED=0
-ZZSTOPSEED=100
-
-# fallbacks for direct, non-"make check" usage
-if test x"$testdatadir" = x""
-then
- testdatadir=../../test
-fi
-if test x"$bindir" = x""
-then
- bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3`
- bindir="$bindir/bin"
-fi
-
-
-for file in $testdatadir/test*
-do
- if test -f "$file"
- then
- tmpfile=`mktemp extractortmp.XXXXXX` || exit 1
- seed=$ZZSTARTSEED
- trap "echo $tmpfile caused SIGSEGV ; exit 1" SEGV
- while [ $seed -lt $ZZSTOPSEED ]
- do
-# echo "file $file seed $seed"
- zzuf -c -s $seed cat "$file" > "$tmpfile"
- if ! "$bindir/extract" "$tmpfile" > /dev/null
- then
- echo "$tmpfile caused error exit"
- exit 1
- fi
- seed=`expr $seed + 1`
- done
- rm -f "$tmpfile"
- fi
-done
-
Deleted: Extractor/src/main/fuzz_thumbnail.sh
===================================================================
--- Extractor/src/main/fuzz_thumbnail.sh 2012-07-30 11:58:01 UTC (rev
22975)
+++ Extractor/src/main/fuzz_thumbnail.sh 2012-07-30 12:59:43 UTC (rev
22976)
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-ZZSTARTSEED=0
-ZZSTOPSEED=100
-
-# fallbacks for direct, non-"make check" usage
-if test x"$testdatadir" = x""
-then
- testdatadir=../../test
-fi
-if test x"$bindir" = x""
-then
- bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3`
- bindir="$bindir/bin"
-fi
-
-
-for file in $testdatadir/*.bmp $testdatadir/*.gif $testdatadir/*.png
$testdatadir/*.ppm
-do
- if test -f "$file"
- then
- tmpfile=`mktemp extractortmp.XXXXXX` || exit 1
- seed=$ZZSTARTSEED
- trap "echo $tmpfile caused SIGSEGV ; exit 1" SEGV
- while [ $seed -lt $ZZSTOPSEED ]
- do
-# echo "file $file seed $seed"
- zzuf -c -s $seed cat "$file" > "$tmpfile"
- if ! "$bindir/extract" -n -l thumbnailffmpeg:thumbnailqt:thumbnailgtk
"$tmpfile" > /dev/null
- then
- echo "$tmpfile caused error exit"
- exit 1
- fi
- seed=`expr $seed + 1`
- done
- rm -f "$tmpfile"
- fi
-done
-
Modified: Extractor/src/main/test_plugin_load_multi.c
===================================================================
--- Extractor/src/main/test_plugin_load_multi.c 2012-07-30 11:58:01 UTC (rev
22975)
+++ Extractor/src/main/test_plugin_load_multi.c 2012-07-30 12:59:43 UTC (rev
22976)
@@ -1,3 +1,22 @@
+/*
+ This file is part of libextractor.
+ (C) 2002, 2003, 2004, 2005, 2006, 2009 Vidyut Samanta and Christian
Grothoff
+
+ libextractor is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ libextractor is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with libextractor; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
/**
* @file main/test_plugin_load_multi.c
* @brief testcase for libextractor plugin loading that loads the same
@@ -8,6 +27,7 @@
#include "platform.h"
#include "extractor.h"
+
static int
testLoadPlugins ()
{
@@ -16,13 +36,13 @@
el1 = EXTRACTOR_plugin_add_defaults (EXTRACTOR_OPTION_DEFAULT_POLICY);
el2 = EXTRACTOR_plugin_add_defaults (EXTRACTOR_OPTION_DEFAULT_POLICY);
- if ((el1 == NULL) || (el2 == NULL))
+ if ((NULL == el1) || (NULL == el2))
{
fprintf (stderr,
"Failed to load default plugins!\n");
- if (el1 != NULL)
+ if (NULL != el1)
EXTRACTOR_plugin_remove_all (el1);
- if (el2 != NULL)
+ if (NULL != el2)
EXTRACTOR_plugin_remove_all (el2);
return 1;
}
@@ -31,6 +51,7 @@
return 0;
}
+
int
main (int argc, char *argv[])
{
@@ -40,3 +61,5 @@
ret += testLoadPlugins ();
return ret;
}
+
+/* end of test_plugin_load_multi.c */
Modified: Extractor/src/main/test_plugin_loading.c
===================================================================
--- Extractor/src/main/test_plugin_loading.c 2012-07-30 11:58:01 UTC (rev
22975)
+++ Extractor/src/main/test_plugin_loading.c 2012-07-30 12:59:43 UTC (rev
22976)
@@ -1,3 +1,23 @@
+/*
+ This file is part of libextractor.
+ (C) 2002, 2003, 2004, 2005, 2006, 2009 Vidyut Samanta and Christian
Grothoff
+
+ libextractor is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ libextractor is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with libextractor; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
/**
* @file main/test_plugin_loading.c
* @brief testcase for dynamic loading and unloading of plugins
@@ -17,20 +37,19 @@
arg = EXTRACTOR_plugin_remove (arg, "mime");
arg = EXTRACTOR_plugin_remove (arg, "zip");
arg = EXTRACTOR_plugin_remove (arg, "png");
- if (arg != NULL)
+ if (NULL != arg)
{
fprintf (stderr,
"add-remove test failed!\n");
return -1;
}
-
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");
- if (arg != NULL)
+ if (NULL != arg)
{
fprintf (stderr,
"add-remove test failed!\n");
@@ -38,3 +57,5 @@
}
return 0;
}
+
+/* end of test_plugin_loading.c */
Modified: Extractor/src/main/test_trivial.c
===================================================================
--- Extractor/src/main/test_trivial.c 2012-07-30 11:58:01 UTC (rev 22975)
+++ Extractor/src/main/test_trivial.c 2012-07-30 12:59:43 UTC (rev 22976)
@@ -1,3 +1,23 @@
+/*
+ This file is part of libextractor.
+ (C) 2002, 2003, 2004, 2005, 2006, 2009 Vidyut Samanta and Christian
Grothoff
+
+ libextractor is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ libextractor is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with libextractor; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
/**
* @file main/test_trivial.c
* @brief trivial testcase for libextractor plugin loading
@@ -11,8 +31,7 @@
{
struct EXTRACTOR_PluginList *pl;
- pl = EXTRACTOR_plugin_add_defaults (policy);
- if (pl == NULL)
+ if (NULL == (pl = EXTRACTOR_plugin_add_defaults (policy)))
{
fprintf (stderr,
"Failed to load default plugins!\n");
@@ -33,3 +52,5 @@
ret += testLoadPlugins (EXTRACTOR_OPTION_OUT_OF_PROCESS_NO_RESTART);
return ret;
}
+
+/* end of test_trivial.c */
Modified: Extractor/src/plugins/Makefile.am
===================================================================
--- Extractor/src/plugins/Makefile.am 2012-07-30 11:58:01 UTC (rev 22975)
+++ Extractor/src/plugins/Makefile.am 2012-07-30 12:59:43 UTC (rev 22976)
@@ -82,3 +82,9 @@
$(top_builddir)/src/common/libextractor_common.la
EXTRA_DIST = template_extractor.c
+
+if HAVE_ZZUF
+ fuzz_tests=fuzz_default.sh fuzz_thumbnail.sh
+endif
+
+TESTS = $(fuzz_tests)
\ No newline at end of file
Copied: Extractor/src/plugins/fuzz_default.sh (from rev 22869,
Extractor/src/main/fuzz_default.sh)
===================================================================
--- Extractor/src/plugins/fuzz_default.sh (rev 0)
+++ Extractor/src/plugins/fuzz_default.sh 2012-07-30 12:59:43 UTC (rev
22976)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+ZZSTARTSEED=0
+ZZSTOPSEED=100
+
+# fallbacks for direct, non-"make check" usage
+if test x"$testdatadir" = x""
+then
+ testdatadir=../../test
+fi
+if test x"$bindir" = x""
+then
+ bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3`
+ bindir="$bindir/bin"
+fi
+
+
+for file in $testdatadir/test*
+do
+ if test -f "$file"
+ then
+ tmpfile=`mktemp extractortmp.XXXXXX` || exit 1
+ seed=$ZZSTARTSEED
+ trap "echo $tmpfile caused SIGSEGV ; exit 1" SEGV
+ while [ $seed -lt $ZZSTOPSEED ]
+ do
+# echo "file $file seed $seed"
+ zzuf -c -s $seed cat "$file" > "$tmpfile"
+ if ! "$bindir/extract" "$tmpfile" > /dev/null
+ then
+ echo "$tmpfile caused error exit"
+ exit 1
+ fi
+ seed=`expr $seed + 1`
+ done
+ rm -f "$tmpfile"
+ fi
+done
+
Copied: Extractor/src/plugins/fuzz_thumbnail.sh (from rev 22869,
Extractor/src/main/fuzz_thumbnail.sh)
===================================================================
--- Extractor/src/plugins/fuzz_thumbnail.sh (rev 0)
+++ Extractor/src/plugins/fuzz_thumbnail.sh 2012-07-30 12:59:43 UTC (rev
22976)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+ZZSTARTSEED=0
+ZZSTOPSEED=100
+
+# fallbacks for direct, non-"make check" usage
+if test x"$testdatadir" = x""
+then
+ testdatadir=../../test
+fi
+if test x"$bindir" = x""
+then
+ bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3`
+ bindir="$bindir/bin"
+fi
+
+
+for file in $testdatadir/*.bmp $testdatadir/*.gif $testdatadir/*.png
$testdatadir/*.ppm
+do
+ if test -f "$file"
+ then
+ tmpfile=`mktemp extractortmp.XXXXXX` || exit 1
+ seed=$ZZSTARTSEED
+ trap "echo $tmpfile caused SIGSEGV ; exit 1" SEGV
+ while [ $seed -lt $ZZSTOPSEED ]
+ do
+# echo "file $file seed $seed"
+ zzuf -c -s $seed cat "$file" > "$tmpfile"
+ if ! "$bindir/extract" -n -l thumbnailffmpeg:thumbnailqt:thumbnailgtk
"$tmpfile" > /dev/null
+ then
+ echo "$tmpfile caused error exit"
+ exit 1
+ fi
+ seed=`expr $seed + 1`
+ done
+ rm -f "$tmpfile"
+ fi
+done
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22976 - in Extractor/src: main plugins,
gnunet <=