Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
87fd6e8c
Commit
87fd6e8c
authored
Nov 03, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSX doesn't support sigqueue().
parent
bcafdb77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
async-test.c++
c++/src/kj/async-test.c++
+1
-1
async-unix-test.c++
c++/src/kj/async-unix-test.c++
+21
-10
common-test.c++
c++/src/kj/common-test.c++
+1
-1
mega-test-quick.cfg
mega-test-quick.cfg
+4
-4
No files found.
c++/src/kj/async-test.c++
View file @
87fd6e8c
...
...
@@ -437,7 +437,7 @@ TEST(Async, TaskSet) {
}));
EXPECT_EQ
(
4
,
counter
);
EXPECT_EQ
(
1
,
errorHandler
.
exceptionCount
);
EXPECT_EQ
(
1
u
,
errorHandler
.
exceptionCount
);
}
}
// namespace
...
...
c++/src/kj/async-unix-test.c++
View file @
87fd6e8c
...
...
@@ -52,6 +52,22 @@ public:
TEST_F
(
AsyncUnixTest
,
Signals
)
{
UnixEventLoop
loop
;
kill
(
getpid
(),
SIGUSR2
);
siginfo_t
info
=
loop
.
wait
(
loop
.
onSignal
(
SIGUSR2
));
EXPECT_EQ
(
SIGUSR2
,
info
.
si_signo
);
EXPECT_EQ
(
SI_USER
,
info
.
si_code
);
}
#ifdef SIGRTMIN
TEST_F
(
AsyncUnixTest
,
SignalWithValue
)
{
// This tests that if we use sigqueue() to attach a value to the signal, that value is received
// correctly. Note that this only works on platforms that support real-time signals -- even
// though the signal we're sending is SIGUSR2, the sigqueue() system call is introduced by RT
// signals. Hence this test won't run on e.g. Mac OSX.
UnixEventLoop
loop
;
union
sigval
value
;
value
.
sival_int
=
123
;
sigqueue
(
getpid
(),
SIGUSR2
,
value
);
...
...
@@ -61,6 +77,7 @@ TEST_F(AsyncUnixTest, Signals) {
EXPECT_EQ
(
SI_QUEUE
,
info
.
si_code
);
EXPECT_EQ
(
123
,
info
.
si_value
.
sival_int
);
}
#endif
TEST_F
(
AsyncUnixTest
,
SignalsMulti
)
{
UnixEventLoop
loop
;
...
...
@@ -71,14 +88,11 @@ TEST_F(AsyncUnixTest, SignalsMulti) {
ADD_FAILURE
()
<<
"Received wrong signal."
;
}));
union
sigval
value
;
value
.
sival_int
=
123
;
sigqueue
(
getpid
(),
SIGUSR2
,
value
);
kill
(
getpid
(),
SIGUSR2
);
siginfo_t
info
=
loop
.
wait
(
loop
.
onSignal
(
SIGUSR2
));
EXPECT_EQ
(
SIGUSR2
,
info
.
si_signo
);
EXPECT_EQ
(
SI_QUEUE
,
info
.
si_code
);
EXPECT_EQ
(
123
,
info
.
si_value
.
sival_int
);
EXPECT_EQ
(
SI_USER
,
info
.
si_code
);
}
TEST_F
(
AsyncUnixTest
,
SignalsAsync
)
{
...
...
@@ -96,17 +110,14 @@ TEST_F(AsyncUnixTest, SignalsAsync) {
[
&
](
siginfo_t
&&
info
)
{
received
=
true
;
EXPECT_EQ
(
SIGUSR2
,
info
.
si_signo
);
EXPECT_EQ
(
SI_QUEUE
,
info
.
si_code
);
EXPECT_EQ
(
123
,
info
.
si_value
.
sival_int
);
EXPECT_EQ
(
SI_USER
,
info
.
si_code
);
});
delay
();
EXPECT_FALSE
(
received
);
union
sigval
value
;
value
.
sival_int
=
123
;
sigqueue
(
getpid
(),
SIGUSR2
,
value
);
kill
(
getpid
(),
SIGUSR2
);
SimpleEventLoop
mainLoop
;
mainLoop
.
wait
(
kj
::
mv
(
promise
));
...
...
c++/src/kj/common-test.c++
View file @
87fd6e8c
...
...
@@ -34,7 +34,7 @@ TEST(Common, Size) {
for
(
size_t
i
:
indices
(
arr
))
{
EXPECT_EQ
(
expected
++
,
i
);
}
EXPECT_EQ
(
4
,
expected
);
EXPECT_EQ
(
4
u
,
expected
);
}
TEST
(
Common
,
Maybe
)
{
...
...
mega-test-quick.cfg
View file @
87fd6e8c
linux-gcc-4.7 16
05
./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 16
08
./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 16
25
./super-test.sh tmpdir capnp-clang quick clang
linux-gcc-4.7 16
30
./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 16
33
./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 16
50
./super-test.sh tmpdir capnp-clang quick clang
mac 758 ./super-test.sh remote beat caffeinate quick
cygwin 76
3
./super-test.sh remote Kenton@flashman quick
cygwin 76
9
./super-test.sh remote Kenton@flashman quick
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