merge small unit tests to make running the tests quicker. expand the test framework a bit. add ax_boost_random.m4 script to link against boost.random correctly from makefile.
This commit is contained in:
parent
9b0313bd8e
commit
f9c9d0ad0d
|
@ -134,7 +134,6 @@ AS_IF([test -z "$BOOST_RANDOM_LIB"],
|
|||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checking for functions and other stuffs
|
||||
###############################################################################
|
||||
|
|
|
@ -38,8 +38,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
namespace libtorrent { namespace aux
|
||||
{
|
||||
// initialized by static initializers (in cpuid.cpp)
|
||||
extern bool sse42_support;
|
||||
extern bool mmx_support;
|
||||
TORRENT_EXTRA_EXPORT extern bool sse42_support;
|
||||
TORRENT_EXTRA_EXPORT extern bool mmx_support;
|
||||
} }
|
||||
|
||||
#endif // TORRENT_CPUID_HPP_INCLUDED
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_boost_random.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_RANDOM
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Random library from the Boost C++ libraries. The macro requires a
|
||||
# preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_RANDOM_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_RANDOM
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2008 Michael Tindal
|
||||
# Copyright (c) 2013 Daniel Casimiro <dan.casimiro@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 1
|
||||
|
||||
AC_DEFUN([AX_BOOST_RANDOM],
|
||||
[
|
||||
AC_ARG_WITH([boost-random],
|
||||
AS_HELP_STRING([--with-boost-random@<:@=special-lib@:>@],
|
||||
[use the Random library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-random=boost_random-gcc-mt ]), [
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_random_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_random_lib="$withval"
|
||||
fi
|
||||
], [want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Random library is available,
|
||||
ax_cv_boost_random,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||
[[@%:@include <boost/random/random_device.hpp>]],
|
||||
[[boost::random::random_device()();]])],
|
||||
ax_cv_boost_random=yes, ax_cv_boost_random=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
|
||||
if test "x$ax_cv_boost_random" = "xyes"; then
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_RANDOM,,[define if the Boost::Random library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
if test "x$ax_boost_user_random_lib" = "x"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/libboost_random*.so* $BOOSTLIBDIR/libboost_random*.dylib* $BOOSTLIBDIR/libboost_random*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_random.*\)\.so.*$;\1;' -e 's;^lib\(boost_random.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_random.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_RANDOM_LIB="-l$ax_lib"; AC_SUBST(BOOST_RANDOM_LIB) link_random="yes"; break],
|
||||
[link_random="no"])
|
||||
done
|
||||
|
||||
if test "x$link_random" != "xyes"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/boost_random*.dll* $BOOSTLIBDIR/boost_random*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_random.*\)\.dll.*$;\1;' -e 's;^\(boost_random.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_RANDOM_LIB="-l$ax_lib"; AC_SUBST(BOOST_RANDOM_LIB) link_random="yes"; break],
|
||||
[link_random="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_random_lib boost_random-$ax_boost_user_random_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_RANDOM_LIB="-l$ax_lib"; AC_SUBST(BOOST_RANDOM_LIB) link_random="yes"; break],
|
||||
[link_random="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
|
||||
if test "x$link_random" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
||||
|
105
test/Jamfile
105
test/Jamfile
|
@ -83,6 +83,7 @@ lib advapi32 : : <name>Advapi32 ;
|
|||
project
|
||||
: requirements
|
||||
<source>main.cpp
|
||||
<source>test.cpp
|
||||
<conditional>@link_test
|
||||
<conditional>@link_libtorrent
|
||||
: default-build
|
||||
|
@ -97,60 +98,63 @@ feature launcher : none valgrind : composite ;
|
|||
feature.compose <launcher>valgrind : <testing.launcher>"valgrind --tool=memcheck -v --num-callers=20 --read-var-info=yes --track-origins=yes --error-exitcode=222 --suppressions=valgrind_suppressions.txt" <use-valgrind>on ;
|
||||
|
||||
test-suite libtorrent :
|
||||
[ run test_timestamp_history.cpp ]
|
||||
[ run test_sha1_hash.cpp ]
|
||||
[ run test_bloom_filter.cpp ]
|
||||
[ run test_identify_client.cpp ]
|
||||
[ run test_merkle.cpp ]
|
||||
[ run test_alert_manager.cpp ]
|
||||
[ run test_resolve_links.cpp ]
|
||||
[ run test_crc32.cpp ]
|
||||
[ run test_heterogeneous_queue.cpp ]
|
||||
[ run test_ip_voter.cpp ]
|
||||
[ run test_resume.cpp ]
|
||||
[ run test_sliding_average.cpp ]
|
||||
[ run test_socket_io.cpp ]
|
||||
[ run test_random.cpp ]
|
||||
[ run test_utf8.cpp ]
|
||||
[ run test_gzip.cpp ]
|
||||
[ run test_bitfield.cpp ]
|
||||
[ run test_recheck.cpp ]
|
||||
[ run test_stat_cache.cpp ]
|
||||
[ run test_part_file.cpp ]
|
||||
[ run test_peer_list.cpp ]
|
||||
[ run test_torrent_info.cpp ]
|
||||
[ run test_time.cpp ]
|
||||
[ run test_file_storage.cpp ]
|
||||
[ run test_priority.cpp ]
|
||||
[ run test_peer_priority.cpp ]
|
||||
[ run test_file.cpp ]
|
||||
[ run test_privacy.cpp ]
|
||||
[ run test_threads.cpp ]
|
||||
[ run test_tailqueue.cpp ]
|
||||
[ run test_bandwidth_limiter.cpp ]
|
||||
[ run test_buffer.cpp ]
|
||||
[ run test_piece_picker.cpp ]
|
||||
[ run test_bencoding.cpp ]
|
||||
[ run test_bdecode.cpp ]
|
||||
[ run test_fast_extension.cpp ]
|
||||
[ run test_primitives.cpp ]
|
||||
[ run test_http_parser.cpp ]
|
||||
[ run test_packet_buffer.cpp ]
|
||||
[ run test_string.cpp ]
|
||||
[ run test_magnet.cpp ]
|
||||
[ run test_xml.cpp ]
|
||||
[ run test_ip_filter.cpp ]
|
||||
[ run test_hasher.cpp ]
|
||||
[ run test_dht.cpp ]
|
||||
[ run test_block_cache.cpp ]
|
||||
[ run test_peer_classes.cpp ]
|
||||
[ run test_settings_pack.cpp ]
|
||||
[ run test_fence.cpp ]
|
||||
[ run
|
||||
test_primitives.cpp
|
||||
test_packet_buffer.cpp
|
||||
test_timestamp_history.cpp
|
||||
test_sha1_hash.cpp
|
||||
test_bloom_filter.cpp
|
||||
test_identify_client.cpp
|
||||
test_merkle.cpp
|
||||
test_alert_manager.cpp
|
||||
test_resolve_links.cpp
|
||||
test_crc32.cpp
|
||||
test_heterogeneous_queue.cpp
|
||||
test_ip_voter.cpp
|
||||
test_sliding_average.cpp
|
||||
test_socket_io.cpp
|
||||
test_random.cpp
|
||||
test_utf8.cpp
|
||||
test_gzip.cpp
|
||||
test_bitfield.cpp
|
||||
test_part_file.cpp
|
||||
test_peer_list.cpp
|
||||
test_torrent_info.cpp
|
||||
test_time.cpp
|
||||
test_file_storage.cpp
|
||||
test_peer_priority.cpp
|
||||
test_threads.cpp
|
||||
test_tailqueue.cpp
|
||||
test_bandwidth_limiter.cpp
|
||||
test_buffer.cpp
|
||||
test_piece_picker.cpp
|
||||
test_bencoding.cpp
|
||||
test_bdecode.cpp
|
||||
test_http_parser.cpp
|
||||
test_string.cpp
|
||||
test_magnet.cpp
|
||||
test_xml.cpp
|
||||
test_ip_filter.cpp
|
||||
test_hasher.cpp
|
||||
test_dht.cpp
|
||||
test_block_cache.cpp
|
||||
test_peer_classes.cpp
|
||||
test_settings_pack.cpp
|
||||
test_fence.cpp
|
||||
test_dos_blocker.cpp
|
||||
test_upnp.cpp ]
|
||||
|
||||
[ run test_storage.cpp ]
|
||||
[ run test_session.cpp ]
|
||||
[ run test_upnp.cpp ]
|
||||
[ run test_read_piece.cpp ]
|
||||
|
||||
[ run test_file.cpp ]
|
||||
[ run test_stat_cache.cpp ]
|
||||
[ run test_fast_extension.cpp ]
|
||||
[ run test_privacy.cpp ]
|
||||
[ run test_priority.cpp ]
|
||||
[ run test_recheck.cpp ]
|
||||
[ run test_resume.cpp ]
|
||||
[ run test_ssl.cpp ]
|
||||
[ run test_tracker.cpp ]
|
||||
[ run test_checking.cpp ]
|
||||
|
@ -165,7 +169,6 @@ test-suite libtorrent :
|
|||
[ run test_web_seed_chunked.cpp ]
|
||||
[ run test_web_seed_ban.cpp ]
|
||||
[ run test_pe_crypto.cpp ]
|
||||
[ run test_dos_blocker.cpp ]
|
||||
|
||||
[ run test_remap_files.cpp ]
|
||||
[ run test_utp.cpp ]
|
||||
|
|
131
test/Makefile.am
131
test/Makefile.am
|
@ -1,49 +1,21 @@
|
|||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
test_programs = \
|
||||
test_timestamp_history \
|
||||
test_sha1_hash \
|
||||
test_bloom_filter \
|
||||
test_identify_client \
|
||||
test_alert_manager \
|
||||
test_bitfield \
|
||||
test_crc32 \
|
||||
test_torrent_info \
|
||||
test_primitives \
|
||||
test_recheck \
|
||||
test_stat_cache \
|
||||
test_part_file \
|
||||
test_file \
|
||||
test_file_storage \
|
||||
test_privacy \
|
||||
test_priority \
|
||||
test_auto_unchoke \
|
||||
test_bandwidth_limiter \
|
||||
test_bdecode_performance \
|
||||
test_bencoding \
|
||||
test_buffer \
|
||||
test_block_cache \
|
||||
test_checking \
|
||||
test_fast_extension \
|
||||
test_hasher \
|
||||
test_heterogeneous_queue \
|
||||
test_http_connection \
|
||||
test_ip_filter \
|
||||
test_ip_voter \
|
||||
test_dht \
|
||||
test_lsd \
|
||||
test_metadata_extension \
|
||||
test_pe_crypto \
|
||||
test_peer_classes \
|
||||
test_peer_list \
|
||||
test_peer_priority \
|
||||
test_pex \
|
||||
test_piece_picker \
|
||||
test_xml \
|
||||
test_string \
|
||||
test_primitives \
|
||||
test_http_parser \
|
||||
test_magnet \
|
||||
test_packet_buffer \
|
||||
test_settings_pack \
|
||||
test_read_piece \
|
||||
test_resume \
|
||||
test_ssl \
|
||||
|
@ -51,24 +23,16 @@ test_programs = \
|
|||
test_time_critical \
|
||||
test_super_seeding \
|
||||
test_swarm \
|
||||
test_tailqueue \
|
||||
test_threads \
|
||||
test_torrent \
|
||||
test_tracker \
|
||||
test_trackers_extension \
|
||||
test_transfer \
|
||||
test_upnp \
|
||||
enum_if \
|
||||
test_utp \
|
||||
test_session \
|
||||
test_web_seed \
|
||||
test_url_seed \
|
||||
test_remap_files \
|
||||
test_gzip \
|
||||
test_utf8 \
|
||||
test_socket_io \
|
||||
test_sliding_average \
|
||||
test_merkle
|
||||
test_remap_files
|
||||
|
||||
if ENABLE_TESTS
|
||||
check_PROGRAMS = $(test_programs)
|
||||
|
@ -138,6 +102,7 @@ noinst_HEADERS = test.hpp setup_transfer.hpp dht_server.hpp \
|
|||
test_utils.hpp
|
||||
|
||||
libtest_la_SOURCES = main.cpp \
|
||||
test.cpp \
|
||||
setup_transfer.cpp \
|
||||
dht_server.cpp \
|
||||
udp_tracker.cpp \
|
||||
|
@ -146,79 +111,89 @@ libtest_la_SOURCES = main.cpp \
|
|||
swarm_suite.cpp \
|
||||
test_utils.cpp
|
||||
|
||||
test_timestamp_history_SOURCES = test_timestamp_history.cpp
|
||||
test_sha1_hash_SOURCES = test_sha1_hash.cpp
|
||||
test_bloom_filter_SOURCES = test_bloom_filter.cpp
|
||||
test_identify_client_SOURCES = test_identify_client.cpp
|
||||
test_alert_manager_SOURCES = test_alert_manager.cpp
|
||||
test_bitfield_SOURCES = test_bitfield.cpp
|
||||
test_crc32_SOURCES = test_crc32.cpp
|
||||
test_torrent_info_SOURCES = test_torrent_info.cpp
|
||||
test_primitives_SOURCES = \
|
||||
test_primitives.cpp \
|
||||
test_packet_buffer.cpp \
|
||||
test_timestamp_history.cpp \
|
||||
test_sha1_hash.cpp \
|
||||
test_bloom_filter.cpp \
|
||||
test_identify_client.cpp \
|
||||
test_merkle.cpp \
|
||||
test_alert_manager.cpp \
|
||||
test_resolve_links.cpp \
|
||||
test_crc32.cpp \
|
||||
test_heterogeneous_queue.cpp \
|
||||
test_ip_voter.cpp \
|
||||
test_sliding_average.cpp \
|
||||
test_socket_io.cpp \
|
||||
test_random.cpp \
|
||||
test_utf8.cpp \
|
||||
test_gzip.cpp \
|
||||
test_bitfield.cpp \
|
||||
test_part_file.cpp \
|
||||
test_peer_list.cpp \
|
||||
test_torrent_info.cpp \
|
||||
test_time.cpp \
|
||||
test_file_storage.cpp \
|
||||
test_peer_priority.cpp \
|
||||
test_threads.cpp \
|
||||
test_tailqueue.cpp \
|
||||
test_bandwidth_limiter.cpp \
|
||||
test_buffer.cpp \
|
||||
test_piece_picker.cpp \
|
||||
test_bencoding.cpp \
|
||||
test_bdecode.cpp \
|
||||
test_http_parser.cpp \
|
||||
test_string.cpp \
|
||||
test_magnet.cpp \
|
||||
test_xml.cpp \
|
||||
test_ip_filter.cpp \
|
||||
test_hasher.cpp \
|
||||
test_dht.cpp \
|
||||
test_block_cache.cpp \
|
||||
test_peer_classes.cpp \
|
||||
test_settings_pack.cpp \
|
||||
test_fence.cpp \
|
||||
test_dos_blocker.cpp \
|
||||
test_upnp.cpp
|
||||
|
||||
test_recheck_SOURCES = test_recheck.cpp
|
||||
test_stat_cache_SOURCES = test_stat_cache.cpp
|
||||
test_part_file_SOURCES = test_part_file.cpp
|
||||
test_file_SOURCES = test_file.cpp
|
||||
test_file_storage_SOURCES = test_file_storage.cpp
|
||||
test_privacy_SOURCES = test_privacy.cpp
|
||||
test_priority_SOURCES = test_priority.cpp
|
||||
test_auto_unchoke_SOURCES = test_auto_unchoke.cpp
|
||||
test_bandwidth_limiter_SOURCES = test_bandwidth_limiter.cpp
|
||||
test_bdecode_performance_SOURCES = test_bdecode_performance.cpp
|
||||
test_dht_SOURCES = test_dht.cpp
|
||||
test_bencoding_SOURCES = test_bencoding.cpp
|
||||
test_buffer_SOURCES = test_buffer.cpp
|
||||
test_block_cache_SOURCES = test_block_cache.cpp
|
||||
test_checking_SOURCES = test_checking.cpp
|
||||
test_fast_extension_SOURCES = test_fast_extension.cpp
|
||||
test_hasher_SOURCES = test_hasher.cpp
|
||||
test_heterogeneous_queue_SOURCES = test_heterogeneous_queue.cpp
|
||||
test_http_connection_SOURCES = test_http_connection.cpp
|
||||
test_ip_filter_SOURCES = test_ip_filter.cpp
|
||||
test_ip_voter_SOURCES = test_ip_voter.cpp
|
||||
test_lsd_SOURCES = test_lsd.cpp
|
||||
test_metadata_extension_SOURCES = test_metadata_extension.cpp
|
||||
test_peer_priority_SOURCES = test_peer_priority.cpp
|
||||
test_pe_crypto_SOURCES = test_pe_crypto.cpp
|
||||
test_peer_classes_SOURCES = test_peer_classes.cpp
|
||||
test_peer_list_SOURCES = test_peer_list.cpp
|
||||
test_pex_SOURCES = test_pex.cpp
|
||||
test_piece_picker_SOURCES = test_piece_picker.cpp
|
||||
test_xml_SOURCES = test_xml.cpp
|
||||
test_string_SOURCES = test_string.cpp
|
||||
test_primitives_SOURCES = test_primitives.cpp
|
||||
test_http_parser_SOURCES = test_http_parser.cpp
|
||||
test_magnet_SOURCES = test_magnet.cpp
|
||||
test_packet_buffer_SOURCES = test_packet_buffer.cpp
|
||||
test_read_piece_SOURCES = test_read_piece.cpp
|
||||
test_storage_SOURCES = test_storage.cpp
|
||||
test_settings_pack_SOURCES = test_settings_pack.cpp
|
||||
test_time_critical_SOURCES = test_time_critical.cpp
|
||||
test_super_seeding_SOURCES = test_super_seeding.cpp
|
||||
test_swarm_SOURCES = test_swarm.cpp
|
||||
test_tailqueue_SOURCES = test_tailqueue.cpp
|
||||
test_resume_SOURCES = test_resume.cpp
|
||||
test_ssl_SOURCES = test_ssl.cpp
|
||||
test_threads_SOURCES = test_threads.cpp
|
||||
test_torrent_SOURCES = test_torrent.cpp
|
||||
test_tracker_SOURCES = test_tracker.cpp
|
||||
test_trackers_extension_SOURCES = test_trackers_extension.cpp
|
||||
test_transfer_SOURCES = test_transfer.cpp
|
||||
test_upnp_SOURCES = test_upnp.cpp
|
||||
enum_if_SOURCES = enum_if.cpp
|
||||
test_utp_SOURCES = test_utp.cpp
|
||||
test_session_SOURCES = test_session.cpp
|
||||
test_web_seed_SOURCES = test_web_seed.cpp
|
||||
test_url_seed_SOURCES = test_url_seed.cpp
|
||||
test_remap_files_SOURCES = test_remap_files.cpp
|
||||
test_gzip_SOURCES = test_gzip.cpp
|
||||
test_utf8_SOURCES = test_utf8.cpp
|
||||
test_socket_io_SOURCES = test_socket_io.cpp
|
||||
test_sliding_average_SOURCES = test_sliding_average.cpp
|
||||
test_merkle_SOURCES = test_merkle.cpp
|
||||
|
||||
LDADD = libtest.la $(top_builddir)/src/libtorrent-rasterbar.la
|
||||
|
||||
#AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@
|
||||
AM_CPPFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@
|
||||
|
||||
AM_LDFLAGS=@BOOST_SYSTEM_LIB@ @PTHREAD_LIBS@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
|
||||
AM_LDFLAGS=@BOOST_SYSTEM_LIB@ @PTHREAD_LIBS@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@ \
|
||||
@BOOST_CHRONO_LIB@
|
||||
|
||||
|
|
|
@ -41,10 +41,8 @@ int main()
|
|||
{
|
||||
io_service ios;
|
||||
error_code ec;
|
||||
address local = guess_local_address(ios);
|
||||
printf("Local address: %s\n", local.to_string(ec).c_str());
|
||||
|
||||
address def_gw = get_default_gateway(ios, ec);
|
||||
address def_gw = get_default_gateway(ec);
|
||||
if (ec)
|
||||
{
|
||||
fprintf(stderr, "%s\n", ec.message().c_str());
|
||||
|
@ -54,7 +52,7 @@ int main()
|
|||
printf("Default gateway: %s\n", def_gw.to_string(ec).c_str());
|
||||
|
||||
printf("=========== Routes ===========\n");
|
||||
std::vector<ip_route> routes = enum_routes(ios, ec);
|
||||
std::vector<ip_route> routes = enum_routes(ec);
|
||||
if (ec)
|
||||
{
|
||||
printf("%s\n", ec.message().c_str());
|
||||
|
|
132
test/main.cpp
132
test/main.cpp
|
@ -37,14 +37,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <stdlib.h> // for exit()
|
||||
#include "libtorrent/address.hpp"
|
||||
#include "libtorrent/socket.hpp"
|
||||
#include "setup_transfer.hpp" // for tests_failure
|
||||
#include "setup_transfer.hpp" // for _g_test_failures
|
||||
#include "test.hpp"
|
||||
#include "dht_server.hpp" // for stop_dht
|
||||
#include "peer_server.hpp" // for stop_peer
|
||||
#include "udp_tracker.hpp" // for stop_udp_tracker
|
||||
|
||||
int test_main();
|
||||
|
||||
#include "libtorrent/assert.hpp"
|
||||
#include "libtorrent/file.hpp"
|
||||
#include <signal.h>
|
||||
|
@ -90,8 +88,49 @@ void sig_handler(int sig)
|
|||
exit(138);
|
||||
}
|
||||
|
||||
int main()
|
||||
void print_usage(char const* argv[])
|
||||
{
|
||||
printf("%s [options] [tests...]\n"
|
||||
"\n"
|
||||
"OPTIONS:\n"
|
||||
"-h,--help show this help\n"
|
||||
"-l,--list list the tests available to run\n"
|
||||
"\n"
|
||||
"for tests, specify one or more test names as printed\n"
|
||||
"by -l. If no test is specified, all tests are run\n", argv[0]);
|
||||
}
|
||||
|
||||
int main(int argc, char const* argv[])
|
||||
{
|
||||
if (argc > 1
|
||||
&& (strcmp(argv[1], "-h") == 0
|
||||
|| strcmp(argv[1], "--help") == 0))
|
||||
{
|
||||
print_usage(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc > 1
|
||||
&& (strcmp(argv[1], "-l") == 0
|
||||
|| strcmp(argv[1], "--list") == 0))
|
||||
{
|
||||
printf("TESTS:\n");
|
||||
for (int i = 0; i < _g_num_unit_tests; ++i)
|
||||
{
|
||||
printf(" - %s\n", _g_unit_tests[i].name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::set<std::string> tests_to_run;
|
||||
bool filter = false;
|
||||
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
tests_to_run.insert(argv[i]);
|
||||
filter = true;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// try to suppress hanging the process by windows displaying
|
||||
// modal dialogs.
|
||||
|
@ -138,11 +177,46 @@ int main()
|
|||
#endif
|
||||
fprintf(stderr, "cwd = \"%s\"\n", test_dir.c_str());
|
||||
|
||||
int total_failures = 0;
|
||||
|
||||
if (_g_num_unit_tests == 0)
|
||||
{
|
||||
fprintf(stderr, "\x1b[31mERROR: no unit tests registered\x1b[0m\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int old_stdout = dup(fileno(stdout));
|
||||
int old_stderr = dup(fileno(stderr));
|
||||
|
||||
int num_run = 0;
|
||||
for (int i = 0; i < _g_num_unit_tests; ++i)
|
||||
{
|
||||
if (filter && tests_to_run.count(_g_unit_tests[i].name) == 0)
|
||||
continue;
|
||||
|
||||
unit_test_t& t = _g_unit_tests[i];
|
||||
|
||||
// redirect test output to a temporary file
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
t.output = tmpfile();
|
||||
int ret1 = dup2(fileno(t.output), fileno(stdout));
|
||||
int ret2 = dup2(fileno(t.output), fileno(stderr));
|
||||
if (ret1 < 0 /*|| ret2 < 0*/)
|
||||
{
|
||||
fprintf(stderr, "failed to redirect output: (%d) %s\n"
|
||||
, errno, strerror(errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif
|
||||
test_main();
|
||||
|
||||
_g_test_failures = 0;
|
||||
(*t.fun)();
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
|
@ -157,6 +231,52 @@ int main()
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!tests_to_run.empty()) tests_to_run.erase(t.name);
|
||||
|
||||
if (_g_test_failures > 0)
|
||||
{
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
dup2(old_stdout, fileno(stdout));
|
||||
dup2(old_stderr, fileno(stderr));
|
||||
|
||||
fseek(t.output, 0, SEEK_SET);
|
||||
fprintf(stderr, "\x1b[1m[%s]\x1b[0m\n\n", t.name);
|
||||
char buf[4096];
|
||||
int size = 0;
|
||||
do {
|
||||
size = fread(buf, 1, sizeof(buf), t.output);
|
||||
if (size > 0) fwrite(buf, 1, size, stderr);
|
||||
} while (size > 0);
|
||||
}
|
||||
|
||||
t.num_failures = _g_test_failures;
|
||||
t.run = true;
|
||||
total_failures += _g_test_failures;
|
||||
++num_run;
|
||||
|
||||
fclose(t.output);
|
||||
}
|
||||
|
||||
dup2(old_stdout, fileno(stdout));
|
||||
dup2(old_stderr, fileno(stderr));
|
||||
|
||||
if (!tests_to_run.empty())
|
||||
{
|
||||
fprintf(stderr, "UNKONWN tests:\n");
|
||||
for (std::set<std::string>::iterator i = tests_to_run.begin()
|
||||
, end(tests_to_run.end()); i != end; ++i)
|
||||
{
|
||||
fprintf(stderr, "%s\n", i->c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (num_run == 0)
|
||||
{
|
||||
fprintf(stderr, "\x1b[31mERROR: no unit tests run\x1b[0m\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// just in case of premature exits
|
||||
// make sure we try to clean up some
|
||||
stop_udp_tracker();
|
||||
|
@ -178,6 +298,6 @@ int main()
|
|||
}
|
||||
#endif
|
||||
|
||||
return ret ? 333 : 0;
|
||||
return total_failures ? 333 : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
using namespace libtorrent;
|
||||
namespace lt = libtorrent;
|
||||
|
||||
static int tests_failure = 0;
|
||||
static std::vector<std::string> failure_strings;
|
||||
|
||||
#if defined TORRENT_WINDOWS
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
@ -104,24 +101,6 @@ udp::endpoint rand_udp_ep()
|
|||
return udp::endpoint(rand_v4(), rand() + 1024);
|
||||
}
|
||||
|
||||
void report_failure(char const* err, char const* file, int line)
|
||||
{
|
||||
char buf[500];
|
||||
snprintf(buf, sizeof(buf), "\x1b[41m***** %s:%d \"%s\" *****\x1b[0m\n", file, line, err);
|
||||
fprintf(stderr, "\n%s\n", buf);
|
||||
failure_strings.push_back(buf);
|
||||
++tests_failure;
|
||||
}
|
||||
|
||||
int print_failures()
|
||||
{
|
||||
if (tests_failure == 0)
|
||||
fprintf(stderr, "\n\n\x1b[42;30m == %d ALL TESTS PASSED ==\x1b[0m\n\n\n", tests_failure);
|
||||
else
|
||||
fprintf(stderr, "\n\n\x1b[41m == %d TEST(S) FAILED ==\x1b[0m\n\n\n", tests_failure);
|
||||
return tests_failure;
|
||||
}
|
||||
|
||||
std::map<std::string, boost::int64_t> get_counters(libtorrent::session& s)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2008-2015, Arvid Norberg
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the author nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <stdio.h> // for tmpfile()
|
||||
#include "test.hpp"
|
||||
|
||||
unit_test_t _g_unit_tests[1024];
|
||||
int _g_num_unit_tests = 0;
|
||||
int _g_test_failures = 0;
|
||||
|
||||
static std::vector<std::string> failure_strings;
|
||||
|
||||
void report_failure(char const* err, char const* file, int line)
|
||||
{
|
||||
char buf[500];
|
||||
snprintf(buf, sizeof(buf), "\x1b[41m***** %s:%d \"%s\" *****\x1b[0m\n", file, line, err);
|
||||
fprintf(stderr, "\n%s\n", buf);
|
||||
failure_strings.push_back(buf);
|
||||
++_g_test_failures;
|
||||
}
|
||||
|
||||
int print_failures()
|
||||
{
|
||||
int longest_name = 0;
|
||||
for (int i = 0; i < _g_num_unit_tests; ++i)
|
||||
{
|
||||
int len = strlen(_g_unit_tests[i].name);
|
||||
if (len > longest_name) longest_name = len;
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n\n");
|
||||
|
||||
for (int i = 0; i < _g_num_unit_tests; ++i)
|
||||
{
|
||||
if (_g_unit_tests[i].run == false) continue;
|
||||
|
||||
if (_g_unit_tests[i].num_failures == 0)
|
||||
{
|
||||
fprintf(stderr, "\x1b[32m[%*s] ***PASS***\n"
|
||||
, longest_name, _g_unit_tests[i].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "\x1b[31m[%*s] %d FAILURES\n"
|
||||
, longest_name
|
||||
, _g_unit_tests[i].name
|
||||
, _g_unit_tests[i].num_failures);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "\x1b[0m");
|
||||
|
||||
if (_g_test_failures > 0)
|
||||
fprintf(stderr, "\n\n\x1b[41m == %d TEST(S) FAILED ==\x1b[0m\n\n\n", _g_test_failures);
|
||||
return _g_test_failures;
|
||||
}
|
||||
|
|
@ -39,6 +39,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#include "libtorrent/config.hpp"
|
||||
|
||||
|
@ -53,18 +55,35 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
void EXPORT report_failure(char const* err, char const* file, int line);
|
||||
int EXPORT print_failures();
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define COUNTER_GUARD(x)
|
||||
#else
|
||||
#define COUNTER_GUARD(type) \
|
||||
struct BOOST_PP_CAT(type, _counter_guard) \
|
||||
{ \
|
||||
~BOOST_PP_CAT(type, _counter_guard()) \
|
||||
{ \
|
||||
TEST_CHECK(counted_type<type>::count == 0); \
|
||||
typedef void (*unit_test_fun_t)();
|
||||
|
||||
struct unit_test_t
|
||||
{
|
||||
unit_test_fun_t fun;
|
||||
char const* name;
|
||||
int num_failures;
|
||||
bool run;
|
||||
FILE* output;
|
||||
};
|
||||
|
||||
extern unit_test_t _g_unit_tests[1024];
|
||||
extern int _g_num_unit_tests;
|
||||
extern int _g_test_failures;
|
||||
|
||||
#define TORRENT_TEST(test_name) \
|
||||
void BOOST_PP_CAT(unit_test_, test_name)(); \
|
||||
static struct BOOST_PP_CAT(register_class, __LINE__) { \
|
||||
BOOST_PP_CAT(register_class, __LINE__) () { \
|
||||
unit_test_t& t = _g_unit_tests[_g_num_unit_tests]; \
|
||||
t.fun = &BOOST_PP_CAT(unit_test_, test_name); \
|
||||
t.name = #test_name; \
|
||||
t.num_failures = 0; \
|
||||
t.run = false; \
|
||||
t.output = NULL; \
|
||||
_g_num_unit_tests++; \
|
||||
} \
|
||||
} BOOST_PP_CAT(type, _guard)
|
||||
#endif
|
||||
} BOOST_PP_CAT(_static_registrar, __LINE__); \
|
||||
void BOOST_PP_CAT(unit_test_, test_name)()
|
||||
|
||||
#define TEST_REPORT_AUX(x, line, file) \
|
||||
report_failure(x, line, file)
|
||||
|
|
|
@ -314,7 +314,7 @@ void test_alert_mask()
|
|||
TEST_CHECK(!mgr.should_post<torrent_paused_alert>());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(alert_manager)
|
||||
{
|
||||
test_limit();
|
||||
test_priority_limit();
|
||||
|
|
|
@ -130,7 +130,7 @@ void test_swarm()
|
|||
p3 = ses3.abort();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(auto_unchoke)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ void do_change_peer_rate(connections_t& v, int limit)
|
|||
i->get()->throttle(limit + limit / 2 * ((c & 1)?-1:1));
|
||||
}
|
||||
|
||||
void nop() {}
|
||||
static void nop() {}
|
||||
|
||||
void run_test(connections_t& v
|
||||
, bandwidth_manager& manager
|
||||
|
@ -457,7 +457,7 @@ void test_no_starvation(int limit)
|
|||
TEST_CHECK(close_to(p->m_quota / sample_time, limit / 200 / num_peers, 5));
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(bandwidth_limiter)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(bdecode)
|
||||
{
|
||||
// test integer
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ entry decode(std::string const& str)
|
|||
return bdecode(str.begin(), str.end());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(bencoding)
|
||||
{
|
||||
// ** strings **
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ void test_iterators(bitfield& test1)
|
|||
TEST_EQUAL(num, test1.count());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(bitfield)
|
||||
{
|
||||
bitfield test1(10, false);
|
||||
TEST_EQUAL(test1.size(), 10);
|
||||
|
|
|
@ -76,7 +76,7 @@ struct test_storage_impl : storage_interface
|
|||
virtual void finalize_file(int, storage_error&) {}
|
||||
};
|
||||
|
||||
void nop() {}
|
||||
static void nop() {}
|
||||
|
||||
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
|
||||
#define INITIALIZE_JOB(j) j.in_use = true;
|
||||
|
@ -455,7 +455,7 @@ void test_unaligned_read()
|
|||
bc.clear(jobs);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(block_cache)
|
||||
{
|
||||
test_write();
|
||||
test_flush();
|
||||
|
@ -472,6 +472,5 @@ int test_main()
|
|||
// TODO: test free_piece
|
||||
// TODO: test abort_dirty
|
||||
// TODO: test unaligned reads
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ void test_to_from_string()
|
|||
TEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(bloom_filter)
|
||||
{
|
||||
test_set_and_get();
|
||||
test_set_bits();
|
||||
|
|
|
@ -118,7 +118,7 @@ void test_speed()
|
|||
|
||||
// -- test buffer --
|
||||
|
||||
void test_buffer()
|
||||
TORRENT_TEST(buffer)
|
||||
{
|
||||
char data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
|
||||
|
@ -209,7 +209,7 @@ bool compare_chained_buffer(chained_buffer& b, char const* mem, int size)
|
|||
return std::memcmp(&flat[0], mem, size) == 0;
|
||||
}
|
||||
|
||||
void test_chained_buffer()
|
||||
TORRENT_TEST(chained_buffer)
|
||||
{
|
||||
char data[] = "foobar";
|
||||
{
|
||||
|
@ -319,10 +319,3 @@ void test_chained_buffer()
|
|||
TEST_CHECK(buffer_list.empty());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
{
|
||||
test_buffer();
|
||||
test_chained_buffer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ void test_checking(int flags = read_only_files)
|
|||
, ec.value(), ec.message().c_str());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(checking)
|
||||
{
|
||||
test_checking();
|
||||
test_checking(read_only_files | corrupt_files);
|
||||
|
|
|
@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/crc32c.hpp"
|
||||
#include "test.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(crc32)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ using namespace libtorrent::dht;
|
|||
|
||||
void nop() {}
|
||||
|
||||
sha1_hash to_hash(char const* s)
|
||||
static sha1_hash to_hash(char const* s)
|
||||
{
|
||||
sha1_hash ret;
|
||||
from_hex(s, 40, (char*)&ret[0]);
|
||||
|
@ -90,7 +90,7 @@ void node_push_back(void* userdata, libtorrent::dht::node_entry const& n)
|
|||
nv->push_back(n);
|
||||
}
|
||||
|
||||
void nop(void* userdata, libtorrent::dht::node_entry const& n) {}
|
||||
static void nop(void* userdata, libtorrent::dht::node_entry const& n) {}
|
||||
|
||||
std::list<std::pair<udp::endpoint, entry> > g_sent_packets;
|
||||
|
||||
|
@ -439,7 +439,7 @@ struct obs : dht::dht_observer
|
|||
};
|
||||
|
||||
// TODO: test obfuscated_get_peers
|
||||
int test_main()
|
||||
TORRENT_TEST(dht)
|
||||
{
|
||||
dht_settings sett;
|
||||
sett.max_torrents = 4;
|
||||
|
@ -1960,7 +1960,7 @@ int test_main()
|
|||
|
||||
#else
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(dht)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ struct log_t : libtorrent::dht::dht_logger
|
|||
}
|
||||
};
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(dos_blocker)
|
||||
{
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
using namespace libtorrent::dht;
|
||||
|
|
|
@ -43,14 +43,14 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/bencode.hpp"
|
||||
#include "libtorrent/entry.hpp"
|
||||
|
||||
#include "aux_/disable_warnings_push.hpp"
|
||||
#include "libtorrent/aux_/disable_warnings_push.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <boost/bind.hpp>
|
||||
#include <iostream>
|
||||
#include <cstdarg>
|
||||
|
||||
#include "aux_/disable_warnings_pop.hpp"
|
||||
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
||||
|
||||
using namespace libtorrent;
|
||||
namespace lt = libtorrent;
|
||||
|
@ -787,7 +787,7 @@ void test_invalid_metadata_requests()
|
|||
print_session_log(*ses);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(fast_extension)
|
||||
{
|
||||
test_reject_fast();
|
||||
test_respect_suggest();
|
||||
|
|
|
@ -203,7 +203,7 @@ void test_disk_job_double_fence()
|
|||
fence.job_complete(&test_job[9], jobs);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(fence)
|
||||
{
|
||||
test_disk_job_fence();
|
||||
test_disk_job_double_fence();
|
||||
|
|
|
@ -103,7 +103,7 @@ void test_stat()
|
|||
TEST_CHECK(diff >= 2 && diff <= 4);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(file)
|
||||
{
|
||||
test_create_directory();
|
||||
test_stat();
|
||||
|
|
|
@ -75,7 +75,7 @@ void setup_test_storage(file_storage& st)
|
|||
TEST_EQUAL(st.num_pieces(), (100000 + 0x3fff) / 0x4000);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(file_storage)
|
||||
{
|
||||
{
|
||||
// test rename_file
|
||||
|
|
|
@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(gzip)
|
||||
{
|
||||
std::vector<char> zipped;
|
||||
error_code ec;
|
||||
|
|
|
@ -60,7 +60,7 @@ char const* result_array[4] =
|
|||
};
|
||||
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(hasher)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ private:
|
|||
F& operator=(F const& f);
|
||||
};
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(heterogeneuous_queue)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ void run_suite(std::string const& protocol, proxy_settings ps, int port)
|
|||
stop_proxy(ps.port);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(http_parser)
|
||||
{
|
||||
std::srand(std::time(0));
|
||||
std::generate(data_buffer, data_buffer + sizeof(data_buffer), &std::rand);
|
||||
|
|
|
@ -76,7 +76,7 @@ tuple<int, int, bool> feed_bytes(http_parser& parser, char const* str)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(http_parser)
|
||||
{
|
||||
// HTTP request parser
|
||||
http_parser parser;
|
||||
|
|
|
@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(identify_client)
|
||||
{
|
||||
TEST_EQUAL(identify_client(peer_id("-AZ123B-............")), "Azureus 1.2.3.11");
|
||||
TEST_EQUAL(identify_client(peer_id("-AZ1230-............")), "Azureus 1.2.3");
|
||||
|
|
|
@ -90,7 +90,7 @@ void test_rules_invariant(std::vector<ip_range<T> > const& r, ip_filter const& f
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(ip_filter)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ void test_one_ip()
|
|||
TEST_CHECK(ipv.external_address() == addr1);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(ip_voter)
|
||||
{
|
||||
test_random();
|
||||
test_two_ips();
|
||||
|
|
|
@ -94,7 +94,7 @@ void test_lsd()
|
|||
p2 = ses2.abort();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(lsd)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void test_remove_url(std::string url)
|
|||
TEST_EQUAL(handles.size(), 0);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(magnet)
|
||||
{
|
||||
session_proxy p1;
|
||||
session_proxy p2;
|
||||
|
|
|
@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "test.hpp"
|
||||
#include "libtorrent/aux_/merkle.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(merkle)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ done:
|
|||
remove_all("tmp2_meta", ec);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(metadata_extension)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using libtorrent::packet_buffer;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(packet_buffer)
|
||||
{
|
||||
// test packet_buffer
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(part_file)
|
||||
{
|
||||
error_code ec;
|
||||
std::string cwd = complete(".");
|
||||
|
|
|
@ -192,7 +192,7 @@ void test_enc_handler(libtorrent::crypto_plugin* a, libtorrent::crypto_plugin* b
|
|||
|
||||
#endif
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(test_pe_crypto)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ std::string class_name(peer_class_t id, peer_class_pool const& p)
|
|||
return i.label;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(peer_class)
|
||||
{
|
||||
peer_class_pool pool;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
tcp::endpoint ep(char const* ip, int port)
|
||||
static tcp::endpoint ep(char const* ip, int port)
|
||||
{
|
||||
return tcp::endpoint(address_v4::from_string(ip), port);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ void connect_peer(peer_list& p, mock_torrent& t, torrent_state& st)
|
|||
TEST_CHECK(tp->connection);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(peer_list)
|
||||
{
|
||||
torrent_peer_allocator allocator;
|
||||
external_ip ext_ip;
|
||||
|
|
|
@ -46,7 +46,7 @@ boost::uint32_t hash_buffer(char const* buf, int len)
|
|||
return crc.checksum();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(peer_priority)
|
||||
{
|
||||
|
||||
// when the IP is the same, we hash the ports, sorted
|
||||
|
|
|
@ -145,7 +145,7 @@ void test_pex()
|
|||
p3 = ses3.abort();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(pex)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
@ -165,6 +165,6 @@ int test_main()
|
|||
}
|
||||
|
||||
#else
|
||||
int test_main() { return 0; }
|
||||
TORRENT_TEST(pex) { return 0; }
|
||||
#endif // TORRENT_DISABLE_EXTENSIONS
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ int test_pick(boost::shared_ptr<piece_picker> const& p
|
|||
return picked[0].piece_index;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(piece_picker)
|
||||
{
|
||||
tcp::endpoint endp;
|
||||
piece_picker::downloading_piece st;
|
||||
|
|
|
@ -71,13 +71,13 @@ address_v6 v6(char const* str)
|
|||
}
|
||||
#endif
|
||||
|
||||
tcp::endpoint ep(char const* ip, int port)
|
||||
static tcp::endpoint ep(char const* ip, int port)
|
||||
{
|
||||
error_code ec;
|
||||
return tcp::endpoint(address::from_string(ip, ec), port);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(primitives)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
error_code ec;
|
||||
|
|
|
@ -394,7 +394,7 @@ done:
|
|||
sp.push_back(ses2.abort());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(priority)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ session_proxy test_proxy(settings_pack::proxy_type_t proxy_type, int flags)
|
|||
return pr;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(privacy)
|
||||
{
|
||||
session_proxy pr[20];
|
||||
// not using anonymous mode
|
||||
|
|
|
@ -32,11 +32,11 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "test.hpp"
|
||||
#include "setup_transfer.hpp"
|
||||
#include "random.hpp"
|
||||
#include "libtorrent/random.hpp"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(random)
|
||||
{
|
||||
|
||||
const int repetitions = 200000;
|
||||
|
|
|
@ -133,7 +133,7 @@ void test_read_piece(int flags)
|
|||
, ec.value(), ec.message().c_str());
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(read_piece)
|
||||
{
|
||||
test_read_piece(0);
|
||||
test_read_piece(seed_mode);
|
||||
|
|
|
@ -66,7 +66,7 @@ void wait_for_complete(lt::session& ses, torrent_handle h)
|
|||
TEST_CHECK(false);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(recheck)
|
||||
{
|
||||
error_code ec;
|
||||
lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48675, 49000), "0.0.0.0", 0, mask);
|
||||
|
|
|
@ -487,7 +487,7 @@ void test_remap_files_prio(storage_mode_t storage_mode = storage_mode_sparse)
|
|||
p2 = ses2.abort();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(remap_files)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ struct test_torrent_t
|
|||
int expected_matches;
|
||||
};
|
||||
|
||||
test_torrent_t test_torrents[] = {
|
||||
static test_torrent_t test_torrents[] = {
|
||||
// no match because shared file in test2 and test3 is not padded/aligned
|
||||
{ "test2", "test1_pad_files", 0},
|
||||
{ "test3", "test1_pad_files", 0},
|
||||
|
@ -83,7 +83,7 @@ test_torrent_t test_torrents[] = {
|
|||
// TODO: it would be nice to test resolving of more than just 2 files as well.
|
||||
// like 3 single file torrents merged into one, resolving all 3 files.
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(resolve_links)
|
||||
{
|
||||
|
||||
#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS
|
||||
|
|
|
@ -175,7 +175,7 @@ void default_tests(torrent_status const& s)
|
|||
TEST_EQUAL(s.completed_time, 1348);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(resume)
|
||||
{
|
||||
torrent_status s;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
using namespace libtorrent;
|
||||
namespace lt = libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(session)
|
||||
{
|
||||
settings_pack p;
|
||||
p.set_int(settings_pack::alert_mask, ~0);
|
||||
|
|
|
@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
using namespace libtorrent;
|
||||
using namespace libtorrent::aux;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(settings_pack)
|
||||
{
|
||||
settings_pack sp;
|
||||
|
||||
|
|
|
@ -35,14 +35,14 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
sha1_hash to_hash(char const* s)
|
||||
static sha1_hash to_hash(char const* s)
|
||||
{
|
||||
sha1_hash ret;
|
||||
from_hex(s, 40, (char*)&ret[0]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(sha1_hash)
|
||||
{
|
||||
sha1_hash h1(0);
|
||||
sha1_hash h2(0);
|
||||
|
|
|
@ -45,7 +45,7 @@ int samples[] = {
|
|||
63, 57, 61, 62, 64, 62, 61, 52, 67, 64, 59, 61, 69, 60, 54, 69 };
|
||||
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(sliding_average)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
using namespace libtorrent;
|
||||
using namespace libtorrent::detail;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(socket_io)
|
||||
{
|
||||
// test address_to_bytes
|
||||
TEST_EQUAL(address_to_bytes(address_v4::from_string("10.11.12.13")), "\x0a\x0b\x0c\x0d");
|
||||
|
|
|
@ -578,7 +578,7 @@ void test_malicious_peer()
|
|||
}
|
||||
#endif // TORRENT_USE_OPENSSL
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(ssl)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(stat_cache)
|
||||
{
|
||||
error_code ec;
|
||||
|
||||
|
|
|
@ -934,7 +934,7 @@ void test_iovec_advance_bufs()
|
|||
free_iov(iov1, 10);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(storage)
|
||||
{
|
||||
test_iovec_copy_bufs();
|
||||
test_iovec_clear_bufs();
|
||||
|
|
|
@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(string)
|
||||
{
|
||||
// test maybe_url_encode
|
||||
TEST_EQUAL(maybe_url_encode("http://test:test@abc.com/abc<>abc"), "http://test:test@abc.com/abc%3c%3eabc");
|
||||
|
|
|
@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "swarm_suite.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(super_seeding)
|
||||
{
|
||||
// with super seeding
|
||||
test_swarm(super_seeding);
|
||||
|
|
|
@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "swarm_suite.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(swarm)
|
||||
{
|
||||
// with seed mode
|
||||
test_swarm(seed_mode);
|
||||
|
|
|
@ -78,7 +78,7 @@ void build_chain(tailqueue& q, char const* str)
|
|||
check_chain(q, expected);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(tailqueue)
|
||||
{
|
||||
tailqueue t1;
|
||||
tailqueue t2;
|
||||
|
|
|
@ -68,7 +68,7 @@ void decrement(condition_variable* s, libtorrent::mutex* m, int* waiting, boost:
|
|||
--*c;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(threads)
|
||||
{
|
||||
condition_variable cond;
|
||||
libtorrent::mutex m;
|
||||
|
|
|
@ -55,7 +55,7 @@ void check_timer_loop(mutex& m, time_point& last, condition_variable& cv)
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(time)
|
||||
{
|
||||
|
||||
// make sure the time classes have correct semantics
|
||||
|
|
|
@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
#include "swarm_suite.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(time_crititcal)
|
||||
{
|
||||
// with time critical pieces
|
||||
test_swarm(time_critical);
|
||||
|
|
|
@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "test.hpp"
|
||||
#include "libtorrent/timestamp_history.hpp"
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(timestamp_history)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ void test_running_torrent(boost::shared_ptr<torrent_info> info, boost::int64_t f
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(torrent)
|
||||
{
|
||||
/* {
|
||||
remove("test_torrent_dir2/tmp1");
|
||||
|
|
|
@ -90,7 +90,7 @@ struct test_torrent_t
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
test_torrent_t test_torrents[] =
|
||||
static test_torrent_t test_torrents[] =
|
||||
{
|
||||
{ "base.torrent" },
|
||||
{ "empty_path.torrent" },
|
||||
|
@ -715,7 +715,7 @@ void test_copy()
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(torrent_info)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
test_resolve_duplicates(i);
|
||||
|
|
|
@ -234,7 +234,7 @@ void test_extract_peer()
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(traccker)
|
||||
{
|
||||
test_extract_peer();
|
||||
test_parse_hostname_peers();
|
||||
|
|
|
@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using boost::tuples::ignore;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(trackers_extension)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
namespace lt = libtorrent;
|
||||
|
@ -134,6 +134,6 @@ int test_main()
|
|||
}
|
||||
|
||||
#else
|
||||
int test_main() { return 0; }
|
||||
TORRENT_TEST(trackers_extension) { return 0; }
|
||||
#endif // TORRENT_DISABLE_EXTENSIONS
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ void test_transfer(int proxy_type, settings_pack const& sett
|
|||
if (proxy_type) stop_proxy(proxy_port);
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(transfer)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ int run_upnp_test(char const* root_filename, char const* router_model, char cons
|
|||
return 0;
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(upnp)
|
||||
{
|
||||
run_upnp_test(combine_path("..", "root1.xml").c_str(), "Xtreme N GIGABIT Router", "wipconn");
|
||||
run_upnp_test(combine_path("..", "root2.xml").c_str(), "D-Link Router", "WANIPConnection");
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::none;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(url_seed)
|
||||
{
|
||||
for (int keepalive = 0; keepalive < 2; ++keepalive)
|
||||
{
|
||||
|
|
|
@ -167,7 +167,7 @@ void expect_error(char const* utf8, ConversionResult expect)
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(utf8)
|
||||
{
|
||||
std::vector<char> utf8_source;
|
||||
error_code ec;
|
||||
|
|
|
@ -128,7 +128,7 @@ void test_transfer()
|
|||
p2 = ses2.abort();
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(utp)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::none;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed)
|
||||
{
|
||||
#ifdef TORRENT_USE_OPENSSL
|
||||
run_http_suite(proxy, "https", false);
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::none;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_ban)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::none;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_chunked)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::http;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_http)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::http_pw;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_http_pw)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_redirect)
|
||||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::socks4;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_socks4)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::socks5;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_socks5)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace libtorrent;
|
|||
|
||||
const int proxy = libtorrent::settings_pack::socks5_pw;
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(web_seed_socks5_pw)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int url_seed = 0; url_seed < 2; ++url_seed)
|
||||
|
|
|
@ -289,7 +289,7 @@ void parser_callback(std::string& out, int token, char const* s, char const* val
|
|||
}
|
||||
}
|
||||
|
||||
int test_main()
|
||||
TORRENT_TEST(xml)
|
||||
{
|
||||
// test upnp xml parser
|
||||
|
||||
|
|
Loading…
Reference in New Issue