Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
cb42c987
Unverified
Commit
cb42c987
authored
Jul 21, 2018
by
Tomoyuki Sahara
Committed by
GitHub
Jul 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4072 from katzer/fix/unsupported_servname
[mruby-socket] Network services might not be available
parents
e3bc680d
0bc8d197
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
mrbgems/mruby-socket/test/addrinfo.rb
mrbgems/mruby-socket/test/addrinfo.rb
+5
-5
mrbgems/mruby-socket/test/socket.rb
mrbgems/mruby-socket/test/socket.rb
+1
-1
No files found.
mrbgems/mruby-socket/test/addrinfo.rb
View file @
cb42c987
...
...
@@ -7,7 +7,7 @@ assert('super class of Addrinfo') do
end
assert
(
'Addrinfo.getaddrinfo'
)
do
ary
=
Addrinfo
.
getaddrinfo
(
"localhost"
,
"domain"
,
Socket
::
AF_INET
,
Socket
::
SOCK_STREAM
)
ary
=
Addrinfo
.
getaddrinfo
(
"localhost"
,
53
,
Socket
::
AF_INET
,
Socket
::
SOCK_STREAM
)
assert_true
(
ary
.
size
>=
1
)
ai
=
ary
[
0
]
assert_equal
(
ai
.
afamily
,
Socket
::
AF_INET
)
...
...
@@ -19,9 +19,9 @@ end
assert
(
'Addrinfo.foreach'
)
do
# assume Addrinfo.getaddrinfo works well
a
=
Addrinfo
.
getaddrinfo
(
"localhost"
,
"domain"
)
a
=
Addrinfo
.
getaddrinfo
(
"localhost"
,
80
)
b
=
[]
Addrinfo
.
foreach
(
"localhost"
,
"domain"
)
{
|
ai
|
b
<<
ai
}
Addrinfo
.
foreach
(
"localhost"
,
80
)
{
|
ai
|
b
<<
ai
}
assert_equal
(
a
.
size
,
b
.
size
)
end
...
...
@@ -35,7 +35,7 @@ assert('Addrinfo.ip') do
end
assert
(
'Addrinfo.tcp'
)
do
ai
=
Addrinfo
.
tcp
(
'127.0.0.1'
,
'smtp'
)
ai
=
Addrinfo
.
tcp
(
'127.0.0.1'
,
25
)
assert_equal
(
'127.0.0.1'
,
ai
.
ip_address
)
assert_equal
(
Socket
::
AF_INET
,
ai
.
afamily
)
assert_equal
(
25
,
ai
.
ip_port
)
...
...
@@ -44,7 +44,7 @@ assert('Addrinfo.tcp') do
end
assert
(
'Addrinfo.udp'
)
do
ai
=
Addrinfo
.
udp
(
'127.0.0.1'
,
'domain'
)
ai
=
Addrinfo
.
udp
(
'127.0.0.1'
,
53
)
assert_equal
(
'127.0.0.1'
,
ai
.
ip_address
)
assert_equal
(
Socket
::
AF_INET
,
ai
.
afamily
)
assert_equal
(
53
,
ai
.
ip_port
)
...
...
mrbgems/mruby-socket/test/socket.rb
View file @
cb42c987
...
...
@@ -5,7 +5,7 @@ assert('Socket.gethostname') do
end
assert
(
'Socket::getaddrinfo'
)
do
ret
=
Socket
.
getaddrinfo
(
"localhost"
,
"domain"
,
Socket
::
AF_INET
,
Socket
::
SOCK_DGRAM
)
ret
=
Socket
.
getaddrinfo
(
"localhost"
,
53
,
Socket
::
AF_INET
,
Socket
::
SOCK_DGRAM
)
assert_true
ret
.
size
>=
1
a
=
ret
[
0
]
assert_equal
"AF_INET"
,
a
[
0
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment