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

Side by Side Diff: mojo/public/c/system/tests/core_unittest_pure_c.c

Issue 2741033003: Mojo EDK: Introduce MojoQueryHandleSignalsState API (Closed)
Patch Set: fix stupid bad DCHECK Created 3 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifdef __cplusplus 5 #ifdef __cplusplus
6 #error "This file should be compiled as C, not C++." 6 #error "This file should be compiled as C, not C++."
7 #endif 7 #endif
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 char buffer[200] = {0}; 47 char buffer[200] = {0};
48 uint32_t num_bytes; 48 uint32_t num_bytes;
49 49
50 ticks = MojoGetTimeTicksNow(); 50 ticks = MojoGetTimeTicksNow();
51 EXPECT_NE(ticks, 0); 51 EXPECT_NE(ticks, 0);
52 52
53 handle0 = MOJO_HANDLE_INVALID; 53 handle0 = MOJO_HANDLE_INVALID;
54 EXPECT_NE(MOJO_RESULT_OK, MojoClose(handle0)); 54 EXPECT_NE(MOJO_RESULT_OK, MojoClose(handle0));
55 55
56 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 56 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
57 MojoQueryHandleSignalsState(handle0, NULL));
58
59 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
57 MojoWait(handle0, ~MOJO_HANDLE_SIGNAL_NONE, 60 MojoWait(handle0, ~MOJO_HANDLE_SIGNAL_NONE,
58 MOJO_DEADLINE_INDEFINITE, NULL)); 61 MOJO_DEADLINE_INDEFINITE, NULL));
59 62
60 handle1 = MOJO_HANDLE_INVALID; 63 handle1 = MOJO_HANDLE_INVALID;
61 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1)); 64 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1));
62 65
63 signals = MOJO_HANDLE_SIGNAL_READABLE; 66 signals = MOJO_HANDLE_SIGNAL_READABLE;
64 uint32_t result_index = 123; 67 uint32_t result_index = 123;
65 struct MojoHandleSignalsState states[1]; 68 struct MojoHandleSignalsState states[1];
66 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, 69 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED,
(...skipping 27 matching lines...) Expand all
94 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes); 97 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes);
95 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello))); 98 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello)));
96 99
97 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0)); 100 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0));
98 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1)); 101 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1));
99 102
100 // TODO(vtl): data pipe 103 // TODO(vtl): data pipe
101 104
102 return NULL; 105 return NULL;
103 } 106 }
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698