mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
fixing test cases
This commit is contained in:
parent
c6590aeda4
commit
1520ad8907
@ -16,29 +16,28 @@ SCENARIO("Test Parse Shadowsocks url", "[ParseSSUrl]")
|
|||||||
{
|
{
|
||||||
auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4", &alias, &err);
|
auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4", &alias, &err);
|
||||||
s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0));
|
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.port == 8888);
|
||||||
REQUIRE(s.password == "test");
|
REQUIRE(s.password.toStdString() == "test");
|
||||||
REQUIRE(s.method == "bf-cfb");
|
REQUIRE(s.method.toStdString() == "bf-cfb");
|
||||||
}
|
}
|
||||||
WHEN("the url with padding")
|
WHEN("the url with padding")
|
||||||
{
|
{
|
||||||
auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xLjE6ODM4OA==", &alias, &err);
|
auto c = ss::Deserialize("ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xLjE6ODM4OA==", &alias, &err);
|
||||||
s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0));
|
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.port == 8388);
|
||||||
REQUIRE(s.password == "test");
|
REQUIRE(s.password.toStdString() == "test");
|
||||||
REQUIRE(s.method == "bf-cfb");
|
REQUIRE(s.method.toStdString() == "bf-cfb");
|
||||||
}
|
}
|
||||||
WHEN("the with remarks")
|
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));
|
s = ShadowSocksServerObject::fromJson(QJsonIO::GetValue(c, "outbounds", 0, "settings", "servers", 0));
|
||||||
qDebug() << s.address << '\n';
|
REQUIRE(s.address.toStdString() == "192.168.100.1");
|
||||||
REQUIRE(s.address == "192.168.100.1");
|
|
||||||
REQUIRE(s.port == 8888);
|
REQUIRE(s.port == 8888);
|
||||||
REQUIRE(s.password == "test");
|
REQUIRE(s.password.toStdString() == "test");
|
||||||
REQUIRE(s.method == "bf-cfb");
|
REQUIRE(s.method.toStdString() == "bf-cfb");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user