fix test_identify_client build with deprecated functions turned off

This commit is contained in:
arvidn 2015-06-19 23:54:38 -04:00
parent e4bc4fc115
commit 1450a692e4
2 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,8 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent namespace libtorrent
{ {
// TODO: hide these declarations when deprecaated functions are disabled, and
// expose them internally in a header under aux_.
// these functions don't really need to be public. This mechanism of // these functions don't really need to be public. This mechanism of
// advertising client software and version is also out-dated. // advertising client software and version is also out-dated.
@ -63,7 +65,6 @@ namespace libtorrent
TORRENT_DEPRECATED_EXPORT TORRENT_DEPRECATED TORRENT_DEPRECATED_EXPORT TORRENT_DEPRECATED
boost::optional<fingerprint> boost::optional<fingerprint>
client_fingerprint(peer_id const& p); client_fingerprint(peer_id const& p);
} }
#endif // TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED #endif // TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED

View File

@ -37,6 +37,7 @@ using namespace libtorrent;
TORRENT_TEST(identify_client) TORRENT_TEST(identify_client)
{ {
#ifndef TORRENT_NO_DEPRECATE
TEST_EQUAL(identify_client(peer_id("-AZ123B-............")), "Azureus 1.2.3.11"); TEST_EQUAL(identify_client(peer_id("-AZ123B-............")), "Azureus 1.2.3.11");
TEST_EQUAL(identify_client(peer_id("-AZ1230-............")), "Azureus 1.2.3"); TEST_EQUAL(identify_client(peer_id("-AZ1230-............")), "Azureus 1.2.3");
TEST_EQUAL(identify_client(peer_id("S123--..............")), "Shadow 1.2.3"); TEST_EQUAL(identify_client(peer_id("S123--..............")), "Shadow 1.2.3");
@ -44,5 +45,6 @@ TORRENT_TEST(identify_client)
TEST_EQUAL(identify_client(peer_id("M1-2-3--............")), "Mainline 1.2.3"); TEST_EQUAL(identify_client(peer_id("M1-2-3--............")), "Mainline 1.2.3");
TEST_EQUAL(identify_client(peer_id("\0\0\0\0\0\0\0\0\0\0\0\0........")), "Generic"); TEST_EQUAL(identify_client(peer_id("\0\0\0\0\0\0\0\0\0\0\0\0........")), "Generic");
TEST_EQUAL(identify_client(peer_id("-xx1230-............")), "xx 1.2.3"); TEST_EQUAL(identify_client(peer_id("-xx1230-............")), "xx 1.2.3");
#endif
} }