Skip to content

Commit

Permalink
Set AI_CANONNAME flag in socket_addrinfo test
Browse files Browse the repository at this point in the history
Musl always populates ai_canonname. Set the flag to avoid output
discrepancies.
  • Loading branch information
nikic committed Aug 5, 2020
1 parent 58ab491 commit 741daa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/sockets/tests/socket_addrinfo_explain.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ if (!extension_loaded('sockets')) {
$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
'ai_family' => AF_INET,
'ai_socktype' => SOCK_DGRAM,
'ai_flags' => AI_CANONNAME,
));
var_dump(socket_addrinfo_explain($addrinfo[0]));
echo "Done";
--EXPECTF--
array(5) {
array(6) {
["ai_flags"]=>
int(%d)
["ai_family"]=>
Expand All @@ -23,6 +24,8 @@ array(5) {
int(2)
["ai_protocol"]=>
int(%d)
["ai_canonname"]=>
string(9) "127.0.0.1"
["ai_addr"]=>
array(2) {
["sin_port"]=>
Expand Down

0 comments on commit 741daa8

Please sign in to comment.