From 7e13b34158bbc7a8fb4509da5f9796096e04c3c3 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 7 Dec 2018 02:17:53 +0100 Subject: [PATCH] fix build i2p=on,off configurations --- examples/client_test.cpp | 3 +-- include/libtorrent/version.hpp | 2 +- test/test_string.cpp | 14 +++++++------- test/test_tracker.cpp | 2 ++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index fee33172e..14d841551 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1070,8 +1070,6 @@ example alert_masks: lt::session_params params; - lt::error_code ec; - #ifndef TORRENT_DISABLE_DHT params.dht_settings.privacy_lookups = true; @@ -1079,6 +1077,7 @@ example alert_masks: if (load_file(".ses_state", in)) { lt::bdecode_node e; + lt::error_code ec; if (bdecode(&in[0], &in[0] + in.size(), e, ec) == 0) params = read_session_params(e, session_handle::save_dht_state); } diff --git a/include/libtorrent/version.hpp b/include/libtorrent/version.hpp index a54df058a..333136965 100644 --- a/include/libtorrent/version.hpp +++ b/include/libtorrent/version.hpp @@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE. #define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTORRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY) #define LIBTORRENT_VERSION "1.2.0.0" -#define LIBTORRENT_REVISION "62cdec8" +#define LIBTORRENT_REVISION "c76e9cc5e" namespace libtorrent { diff --git a/test/test_string.cpp b/test/test_string.cpp index 549327696..e9796f191 100644 --- a/test/test_string.cpp +++ b/test/test_string.cpp @@ -218,11 +218,11 @@ TORRENT_TEST(base64) TEST_CHECK(base64encode("foobar") == "Zm9vYmFy"); } -#if TORRENT_USE_I2P TORRENT_TEST(base32) { // base32 test vectors from http://www.faqs.org/rfcs/rfc4648.html +#if TORRENT_USE_I2P TEST_CHECK(base32encode("") == ""); TEST_CHECK(base32encode("f") == "MY======"); TEST_CHECK(base32encode("fo") == "MZXQ===="); @@ -235,6 +235,12 @@ TORRENT_TEST(base32) TEST_CHECK(base32encode("fo", string::no_padding) == "MZXQ"); TEST_CHECK(base32encode("foob", string::i2p) == "mzxw6yq"); TEST_CHECK(base32encode("foobar", string::lowercase) == "mzxw6ytboi======"); + + std::string test; + for (int i = 0; i < 255; ++i) + test += char(i); + + TEST_CHECK(base32decode(base32encode(test)) == test); #endif // TORRENT_USE_I2P TEST_CHECK(base32decode("") == ""); @@ -252,12 +258,6 @@ TORRENT_TEST(base32) // make sure invalid encoding returns the empty string TEST_CHECK(base32decode("mZXw6yTBO1{#&*()=") == ""); - - std::string test; - for (int i = 0; i < 255; ++i) - test += char(i); - - TEST_CHECK(base32decode(base32encode(test)) == test); } TORRENT_TEST(escape_string) diff --git a/test/test_tracker.cpp b/test/test_tracker.cpp index e7ca3c2fe..fee60960a 100644 --- a/test/test_tracker.cpp +++ b/test/test_tracker.cpp @@ -110,6 +110,7 @@ TORRENT_TEST(parse_peers4) } } +#if TORRENT_USE_I2P TORRENT_TEST(parse_i2p_peers) { // d8:completei8e10:incompletei4e8:intervali3600e5:peers352: ... @@ -171,6 +172,7 @@ TORRENT_TEST(parse_i2p_peers) , "ufunemgwuun5t2sn3oay4zv7jvwdezwcrirgwr6b2fjgczvaowvq.b32.i2p"); } } +#endif // TORRENT_USE_I2P TORRENT_TEST(parse_interval) {