diff options
author | Ji Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96> | 2009-10-15 12:45:20 +0000 |
---|---|---|
committer | Ji Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96> | 2009-10-15 12:45:20 +0000 |
commit | 81ec1cfb37dda15a709bb55974dc8be73d0374a7 (patch) | |
tree | 576d09f4cc3d652ba330293ba6abf143c87dca7a | |
parent | b112d32f73e5fa9361af6ac2ff119220302f3e62 (diff) | |
download | gnunet-81ec1cfb37dda15a709bb55974dc8be73d0374a7.tar.gz gnunet-81ec1cfb37dda15a709bb55974dc8be73d0374a7.zip |
bio testcase harness
-rw-r--r-- | m4/libtool.m4 | 27 | ||||
-rw-r--r-- | m4/ltdl.m4 | 2 | ||||
-rw-r--r-- | src/util/test_bio.c | 37 |
3 files changed, 32 insertions, 34 deletions
diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 1e7ea47c0..39ba996cb 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 | |||
@@ -2485,18 +2485,6 @@ linux* | k*bsd*-gnu) | |||
2485 | dynamic_linker='GNU/Linux ld.so' | 2485 | dynamic_linker='GNU/Linux ld.so' |
2486 | ;; | 2486 | ;; |
2487 | 2487 | ||
2488 | netbsdelf*-gnu) | ||
2489 | version_type=linux | ||
2490 | need_lib_prefix=no | ||
2491 | need_version=no | ||
2492 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' | ||
2493 | soname_spec='${libname}${release}${shared_ext}$major' | ||
2494 | shlibpath_var=LD_LIBRARY_PATH | ||
2495 | shlibpath_overrides_runpath=no | ||
2496 | hardcode_into_libs=yes | ||
2497 | dynamic_linker='NetBSD ld.elf_so' | ||
2498 | ;; | ||
2499 | |||
2500 | netbsd*) | 2488 | netbsd*) |
2501 | version_type=sunos | 2489 | version_type=sunos |
2502 | need_lib_prefix=no | 2490 | need_lib_prefix=no |
@@ -3088,7 +3076,7 @@ linux* | k*bsd*-gnu) | |||
3088 | lt_cv_deplibs_check_method=pass_all | 3076 | lt_cv_deplibs_check_method=pass_all |
3089 | ;; | 3077 | ;; |
3090 | 3078 | ||
3091 | netbsd* | netbsdelf*-gnu) | 3079 | netbsd*) |
3092 | if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then | 3080 | if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then |
3093 | lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' | 3081 | lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' |
3094 | else | 3082 | else |
@@ -3769,7 +3757,7 @@ m4_if([$1], [CXX], [ | |||
3769 | ;; | 3757 | ;; |
3770 | esac | 3758 | esac |
3771 | ;; | 3759 | ;; |
3772 | netbsd* | netbsdelf*-gnu) | 3760 | netbsd*) |
3773 | ;; | 3761 | ;; |
3774 | *qnx* | *nto*) | 3762 | *qnx* | *nto*) |
3775 | # QNX uses GNU C++, but need to define -shared option too, otherwise | 3763 | # QNX uses GNU C++, but need to define -shared option too, otherwise |
@@ -4194,9 +4182,6 @@ m4_if([$1], [CXX], [ | |||
4194 | cygwin* | mingw* | cegcc*) | 4182 | cygwin* | mingw* | cegcc*) |
4195 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' | 4183 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' |
4196 | ;; | 4184 | ;; |
4197 | linux* | k*bsd*-gnu) | ||
4198 | _LT_TAGVAR(link_all_deplibs, $1)=no | ||
4199 | ;; | ||
4200 | *) | 4185 | *) |
4201 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' | 4186 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' |
4202 | ;; | 4187 | ;; |
@@ -4261,9 +4246,6 @@ dnl Note also adjust exclude_expsyms for C++ above. | |||
4261 | openbsd*) | 4246 | openbsd*) |
4262 | with_gnu_ld=no | 4247 | with_gnu_ld=no |
4263 | ;; | 4248 | ;; |
4264 | linux* | k*bsd*-gnu) | ||
4265 | _LT_TAGVAR(link_all_deplibs, $1)=no | ||
4266 | ;; | ||
4267 | esac | 4249 | esac |
4268 | 4250 | ||
4269 | _LT_TAGVAR(ld_shlibs, $1)=yes | 4251 | _LT_TAGVAR(ld_shlibs, $1)=yes |
@@ -4446,7 +4428,7 @@ _LT_EOF | |||
4446 | fi | 4428 | fi |
4447 | ;; | 4429 | ;; |
4448 | 4430 | ||
4449 | netbsd* | netbsdelf*-gnu) | 4431 | netbsd*) |
4450 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then | 4432 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
4451 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' | 4433 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' |
4452 | wlarc= | 4434 | wlarc= |
@@ -4621,7 +4603,6 @@ _LT_EOF | |||
4621 | if test "$aix_use_runtimelinking" = yes; then | 4603 | if test "$aix_use_runtimelinking" = yes; then |
4622 | shared_flag="$shared_flag "'${wl}-G' | 4604 | shared_flag="$shared_flag "'${wl}-G' |
4623 | fi | 4605 | fi |
4624 | _LT_TAGVAR(link_all_deplibs, $1)=no | ||
4625 | else | 4606 | else |
4626 | # not using gcc | 4607 | # not using gcc |
4627 | if test "$host_cpu" = ia64; then | 4608 | if test "$host_cpu" = ia64; then |
@@ -4860,7 +4841,7 @@ _LT_EOF | |||
4860 | _LT_TAGVAR(link_all_deplibs, $1)=yes | 4841 | _LT_TAGVAR(link_all_deplibs, $1)=yes |
4861 | ;; | 4842 | ;; |
4862 | 4843 | ||
4863 | netbsd* | netbsdelf*-gnu) | 4844 | netbsd*) |
4864 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then | 4845 | if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then |
4865 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out | 4846 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out |
4866 | else | 4847 | else |
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index 46535e2e1..f6be54a94 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 | |||
@@ -487,7 +487,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen], | |||
487 | # at 6.2 and later dlopen does load deplibs. | 487 | # at 6.2 and later dlopen does load deplibs. |
488 | lt_cv_sys_dlopen_deplibs=yes | 488 | lt_cv_sys_dlopen_deplibs=yes |
489 | ;; | 489 | ;; |
490 | netbsd* | netbsdelf*-gnu) | 490 | netbsd*) |
491 | lt_cv_sys_dlopen_deplibs=yes | 491 | lt_cv_sys_dlopen_deplibs=yes |
492 | ;; | 492 | ;; |
493 | openbsd*) | 493 | openbsd*) |
diff --git a/src/util/test_bio.c b/src/util/test_bio.c index c4c838675..ed51cb849 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c | |||
@@ -23,23 +23,40 @@ | |||
23 | * @brief testcase for the buffered IO module | 23 | * @brief testcase for the buffered IO module |
24 | * @author | 24 | * @author |
25 | */ | 25 | */ |
26 | |||
27 | |||
26 | #include "platform.h" | 28 | #include "platform.h" |
27 | #include "gnunet_common.h" | 29 | #include "gnunet_common.h" |
28 | #include "gnunet_disk_lib.h" | 30 | #include "gnunet_disk_lib.h" |
29 | #include "gnunet_scheduler_lib.h" | 31 | #include "gnunet_bio_lib.h" |
32 | |||
33 | int check(){ | ||
34 | |||
35 | int suc; | ||
36 | char* fileName = GNUNET_DISK_mktemp ("gnunet_bio"); | ||
37 | struct GNUNET_BIO_ReadHandle *fileR; | ||
38 | struct GNUNET_BIO_WriteHandle *fileW; | ||
39 | char *msg; | ||
40 | fileR = GNUNET_BIO_read_open (fileName); | ||
41 | GNUNET_BIO_read_close(fileR,&msg); | ||
42 | fileW = GNUNET_BIO_write_open(fileName); | ||
43 | if (GNUNET_OK == GNUNET_BIO_write_close(fileW)) | ||
44 | suc = 0; | ||
45 | else | ||
46 | suc = 1; | ||
47 | |||
48 | return suc; | ||
49 | |||
50 | |||
51 | } | ||
30 | 52 | ||
31 | 53 | ||
32 | 54 | ||
33 | int | 55 | int |
34 | main (int argc, char *argv[]) | 56 | main (int argc, char *argv[]) |
35 | { | 57 | { |
36 | unsigned int failureCount = 0; | 58 | |
37 | 59 | int ch = check(); | |
38 | GNUNET_log_setup ("test-bio", "WARNING", NULL); | 60 | return ch; |
39 | if (failureCount != 0) | 61 | |
40 | { | ||
41 | fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount); | ||
42 | return -1; | ||
43 | } | ||
44 | return 0; | ||
45 | } /* end of main */ | 62 | } /* end of main */ |