From 1520ad8907d5a5439d644a64fc91b3dca70333ce Mon Sep 17 00:00:00 2001 From: DuckSoft Date: Sat, 16 May 2020 16:34:03 +0800 Subject: [PATCH] fixing test cases --- test/src/core/connection/TestParseSS.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/src/core/connection/TestParseSS.cpp b/test/src/core/connection/TestParseSS.cpp index 63f01c2d..9fc780b6 100644 --- a/test/src/core/connection/TestParseSS.cpp +++ b/test/src/core/connection/TestParseSS.cpp @@ -16,29 +16,28 @@ SCENARIO("Test Parse Shadowsocks url", "[ParseSSUrl]") { auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4", &alias, &err); s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0)); - REQUIRE(s.address == "192.168.100.1"); + REQUIRE(s.address.toStdString() == "192.168.100.1"); REQUIRE(s.port == 8888); - REQUIRE(s.password == "test"); - REQUIRE(s.method == "bf-cfb"); + REQUIRE(s.password.toStdString() == "test"); + REQUIRE(s.method.toStdString() == "bf-cfb"); } WHEN("the url with padding") { auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xLjE6ODM4OA==", &alias, &err); s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0)); - REQUIRE(s.address == "192.168.1.1"); + REQUIRE(s.address.toStdString() == "192.168.1.1"); REQUIRE(s.port == 8388); - REQUIRE(s.password == "test"); - REQUIRE(s.method == "bf-cfb"); + REQUIRE(s.password.toStdString() == "test"); + REQUIRE(s.method.toStdString() == "bf-cfb"); } WHEN("the with remarks") { - auto c = ss::Deserialize(",ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4#example-server", &alias, &err); + auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4#example-server", &alias, &err); s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0)); - qDebug() << s.address << '\n'; - REQUIRE(s.address == "192.168.100.1"); + REQUIRE(s.address.toStdString() == "192.168.100.1"); REQUIRE(s.port == 8888); - REQUIRE(s.password == "test"); - REQUIRE(s.method == "bf-cfb"); + REQUIRE(s.password.toStdString() == "test"); + REQUIRE(s.method.toStdString() == "bf-cfb"); } } }