This repository has been archived by the owner on Sep 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from mwielpue/bugfix/EAF-587-java-links-cannot-…
…connect EAF-587 the broker will now change the host address to something comp…
- Loading branch information
Showing
9 changed files
with
186 additions
and
24 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
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 |
---|---|---|
|
@@ -19,6 +19,7 @@ set(SDK_TEST_SET | |
|
||
set(BROKER_TEST_SET | ||
"node_test" | ||
"utils_test" | ||
) | ||
|
||
function(add_memcheck_test name) | ||
|
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "cmocka_init.h" | ||
|
||
#include <broker/utils.h> | ||
|
||
static | ||
void setHostFrom_test(void** state) | ||
{ | ||
(void) state; | ||
|
||
assert_string_equal(setHostFrom("http", "localhost", "12345"), "http://localhost:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "anyhost.de", "12345"), "http://anyhost.de:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "1.2.3.4", "12345"), "http://1.2.3.4:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "0:1:2:3:4:5:6:7", "8888"), "http://[0:1:2:3:4:5:6:7]:8888/conn" ); | ||
assert_string_equal(setHostFrom("http", "0:1:2::7:8", "8888"), "http://[0:1:2::7:8]:8888/conn" ); | ||
|
||
// Special case IPv4 unspecified address | ||
assert_string_equal(setHostFrom("http", "0.0.0.0", "12345"), "http://127.0.0.1:12345/conn" ); | ||
|
||
// Special case IPv6 unspecified address | ||
assert_string_equal(setHostFrom("http", "::/0", "12345"), "http://[::1]:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "::/128", "23456"), "http://[::1]:23456/conn" ); | ||
assert_string_equal(setHostFrom("http", "::1", "1234"), "http://[::1]:1234/conn" ); | ||
assert_string_equal(setHostFrom("http", "0:0:0::0", "12345"), "http://[::1]:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "0:0::0:0", "12345"), "http://[::1]:12345/conn" ); | ||
assert_string_equal(setHostFrom("http", "0:0:0:0:0:0:0:0", "12345"), "http://[::1]:12345/conn" ); | ||
|
||
|
||
} | ||
|
||
|
||
int main() { | ||
const struct CMUnitTest tests[] = { | ||
cmocka_unit_test(setHostFrom_test) | ||
}; | ||
|
||
return cmocka_run_group_tests(tests, NULL, NULL); | ||
} |
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