Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: mojo/public/c/system/tests/core_unittest_pure_c.c

Issue 776993002: Fix mojo_public_system_unittests CoreTest.MinimalCTest. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/tests/core_unittest_pure_c.c
diff --git a/mojo/public/c/system/tests/core_unittest_pure_c.c b/mojo/public/c/system/tests/core_unittest_pure_c.c
index 46969347664646fe81097f10343504b53d9ce5ce..bb00927c3b664870b6c36daa4b1b5fa59d4178f6 100644
--- a/mojo/public/c/system/tests/core_unittest_pure_c.c
+++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -61,14 +61,17 @@ const char* MinimalCTest(void) {
EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1));
signals = MOJO_HANDLE_SIGNAL_READABLE;
- uint32_t result_index = 1;
+ uint32_t result_index = 123;
struct MojoHandleSignalsState states[1];
EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED,
MojoNewWaitMany(&handle0, &signals, 1, 1, &result_index, states));
- EXPECT_EQ(0u, result_index);
+ // "Deadline exceeded" doesn't apply to a single handle, so this should leave
+ // |result_index| untouched.
+ EXPECT_EQ(123u, result_index);
EXPECT_EQ(MOJO_HANDLE_SIGNAL_WRITABLE, states[0].satisfied_signals);
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
+ EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE |
+ MOJO_HANDLE_SIGNAL_PEER_CLOSED,
states[0].satisfiable_signals);
EXPECT_EQ(MOJO_RESULT_OK,
@@ -87,7 +90,8 @@ const char* MinimalCTest(void) {
EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
state.satisfied_signals);
- EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE,
+ EXPECT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_WRITABLE |
+ MOJO_HANDLE_SIGNAL_PEER_CLOSED,
state.satisfiable_signals);
num_bytes = (uint32_t)sizeof(buffer);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698