diff --git a/test/test_primitives.cpp b/test/test_primitives.cpp index fa1d8738e..f406ca035 100644 --- a/test/test_primitives.cpp +++ b/test/test_primitives.cpp @@ -231,10 +231,13 @@ int test_main() // test identify_client - TEST_CHECK(identify_client(peer_id("-AZ1234-............")) == "Azureus 1.2.3.4"); - TEST_CHECK(identify_client(peer_id("-AZ1230-............")) == "Azureus 1.2.3"); - TEST_CHECK(identify_client(peer_id("S123--..............")) == "Shadow 1.2.3"); - TEST_CHECK(identify_client(peer_id("M1-2-3--............")) == "Mainline 1.2.3"); + 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("S123--..............")), "Shadow 1.2.3"); + TEST_EQUAL(identify_client(peer_id("S\x1\x2\x3....\0...........")), "Shadow 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("-xx1230-............")), "xx 1.2.3"); // test network functions