Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stunserver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
Stunserver
Commits
c9ab6dbe
Commit
c9ab6dbe
authored
Feb 24, 2013
by
jselbie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
differentiate CTestRecvFromEx into IPV4 and IPV6 tests
parent
1c3f44c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
testcode/testcode.cpp
testcode/testcode.cpp
+4
-2
testcode/testrecvfromex.cpp
testcode/testrecvfromex.cpp
+7
-15
testcode/testrecvfromex.h
testcode/testrecvfromex.h
+13
-5
No files found.
testcode/testcode.cpp
View file @
c9ab6dbe
...
...
@@ -78,7 +78,8 @@ void RunUnitTests()
boost
::
shared_ptr
<
CTestMessageHandler
>
spTestMessageHandler
(
new
CTestMessageHandler
);
boost
::
shared_ptr
<
CTestCmdLineParser
>
spTestCmdLineParser
(
new
CTestCmdLineParser
);
boost
::
shared_ptr
<
CTestClientLogic
>
spTestClientLogic
(
new
CTestClientLogic
);
boost
::
shared_ptr
<
CTestRecvFromEx
>
spTestRecvFromEx
(
new
CTestRecvFromEx
);
boost
::
shared_ptr
<
CTestRecvFromExIPV4
>
spTestRecvFromEx4
(
new
CTestRecvFromExIPV4
);
boost
::
shared_ptr
<
CTestRecvFromExIPV6
>
spTestRecvFromEx6
(
new
CTestRecvFromExIPV6
);
boost
::
shared_ptr
<
CTestFastHash
>
spTestFastHash
(
new
CTestFastHash
);
boost
::
shared_ptr
<
CTestPolling
>
spTestPolling
(
new
CTestPolling
);
...
...
@@ -89,7 +90,8 @@ void RunUnitTests()
vecTests
.
push_back
(
spTestMessageHandler
.
get
());
vecTests
.
push_back
(
spTestCmdLineParser
.
get
());
vecTests
.
push_back
(
spTestClientLogic
.
get
());
vecTests
.
push_back
(
spTestRecvFromEx
.
get
());
vecTests
.
push_back
(
spTestRecvFromEx4
.
get
());
vecTests
.
push_back
(
spTestRecvFromEx6
.
get
());
vecTests
.
push_back
(
spTestFastHash
.
get
());
vecTests
.
push_back
(
spTestPolling
.
get
());
...
...
testcode/testrecvfromex.cpp
View file @
c9ab6dbe
...
...
@@ -23,27 +23,19 @@
#include "stunsocket.h"
HRESULT
CTestRecvFromEx
::
Run
()
HRESULT
CTestRecvFromEx
IPV4
::
Run
()
{
HRESULT
hr1
=
S_OK
,
hr2
=
S_OK
;
HRESULT
hr
=
S_OK
;
return
CTestRecvFromEx
::
DoTest
(
false
);
// ipv4
hr1
=
DoTest
(
false
);
// ipv4
printf
(
"Test result of recvfromex on ipv4. Result: %s
\n
"
,
SUCCEEDED
(
hr1
)
?
"Pass"
:
"Fail"
);
hr2
=
DoTest
(
true
);
// ipv6
printf
(
"Test result of recvfromex on ipv6. Result: %s
\n
"
,
SUCCEEDED
(
hr2
)
?
"Pass"
:
"Fail"
);
}
Chk
(
hr1
);
Chk
(
hr2
);
Cleanup:
return
hr
;
HRESULT
CTestRecvFromExIPV6
::
Run
()
{
return
CTestRecvFromEx
::
DoTest
(
true
);
// ipv6
}
// This test validates that the EnablePktInfoOption set on a socket allows us to get at the destination IP address for incoming packets
// This is needed so that we can correctly insert an origin address into responses from the server
// Otherwise, the server doesn't have a way of knowing which interface a packet arrived on when it's listening on INADDR_ANY (all available addresses)
...
...
testcode/testrecvfromex.h
View file @
c9ab6dbe
...
...
@@ -23,15 +23,23 @@
#include "unittest.h"
class
CTestRecvFromEx
:
public
IUnitTest
class
CTestRecvFromEx
{
public:
HRESULT
DoTest
(
bool
fUseIPV6
);
static
HRESULT
DoTest
(
bool
fUseIPV6
);
};
class
CTestRecvFromExIPV4
:
public
IUnitTest
{
HRESULT
Run
();
UT_DECLARE_TEST_NAME
(
"CTestRecvFromEx(IPV4)"
);
};
UT_DECLARE_TEST_NAME
(
"CTestRecvFromEx"
);
class
CTestRecvFromExIPV6
:
public
IUnitTest
{
HRESULT
Run
();
UT_DECLARE_TEST_NAME
(
"CTestRecvFromEx(IPV6)"
);
};
#endif
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