-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[websockets] Encode charge point identifier in URL
- Loading branch information
Showing
5 changed files
with
42 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,21 +80,6 @@ TEST_SUITE("Nominal - hostname as string") | |
CHECK_EQ(url.path(), "/paf/pouf/"); | ||
} | ||
|
||
TEST_CASE("URL with port and encoded path") | ||
{ | ||
Url url("ftp://pif.com:12345/paf [ pouf / + BIM_bam) = boum ] 10.11.12.13!"); | ||
|
||
CHECK(url.isValid()); | ||
CHECK_EQ(url.url(), | ||
R"(ftp://pif.com:12345/paf%20%5b%20pouf%20/%20%20%2b%20BIM%5fbam%29%20%3d%20boum%20%5d%2010%2e11%2e12%2e13%21)"); | ||
CHECK_EQ(url.protocol(), "ftp"); | ||
CHECK_EQ(url.username(), ""); | ||
CHECK_EQ(url.password(), ""); | ||
CHECK_EQ(url.address(), "pif.com"); | ||
CHECK_EQ(url.port(), 12345); | ||
CHECK_EQ(url.path(), R"(/paf%20%5b%20pouf%20/%20%20%2b%20BIM%5fbam%29%20%3d%20boum%20%5d%2010%2e11%2e12%2e13%21)"); | ||
} | ||
|
||
TEST_CASE("URL with username and port") | ||
{ | ||
Url url("ftp://[email protected]:12345"); | ||
|
@@ -228,21 +213,6 @@ TEST_SUITE("Nominal - hostname as IP address") | |
CHECK_EQ(url.path(), "/paf/pouf/"); | ||
} | ||
|
||
TEST_CASE("URL with port and encoded path") | ||
{ | ||
Url url("ftp://10.189.70.3:12345/paf [ pouf / + BIM_bam) = boum ] 10.11.12.13!"); | ||
|
||
CHECK(url.isValid()); | ||
CHECK_EQ(url.url(), | ||
R"(ftp://10.189.70.3:12345/paf%20%5b%20pouf%20/%20%20%2b%20BIM%5fbam%29%20%3d%20boum%20%5d%2010%2e11%2e12%2e13%21)"); | ||
CHECK_EQ(url.protocol(), "ftp"); | ||
CHECK_EQ(url.username(), ""); | ||
CHECK_EQ(url.password(), ""); | ||
CHECK_EQ(url.address(), "10.189.70.3"); | ||
CHECK_EQ(url.port(), 12345); | ||
CHECK_EQ(url.path(), R"(/paf%20%5b%20pouf%20/%20%20%2b%20BIM%5fbam%29%20%3d%20boum%20%5d%2010%2e11%2e12%2e13%21)"); | ||
} | ||
|
||
TEST_CASE("URL with username and port") | ||
{ | ||
Url url("ftp://[email protected]:12345"); | ||
|
@@ -316,6 +286,12 @@ TEST_SUITE("Nominal - hostname as IP address") | |
CHECK_EQ(url1.port(), url2.port()); | ||
CHECK_EQ(url1.path(), url2.path()); | ||
} | ||
|
||
TEST_CASE("URL percent encoding") | ||
{ | ||
std::string url("paf [ pouf / + BIM_bam) = boum ] 10.11.12.13!"); | ||
CHECK_EQ(Url::encode(url), R"(paf%20%5B%20pouf%20%2F%20%20%2B%20BIM_bam%29%20%3D%20boum%20%5D%2010.11.12.13%21)"); | ||
} | ||
} | ||
|
||
TEST_SUITE("Errors") | ||
|