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

Side by Side Diff: mojo/public/c/system/tests/core_unittest.cc

Issue 324783002: Mojo: Add a MojoCreateMessagePipeOptions struct parameter to MojoCreateMessagePipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // This file tests the C API. 5 // This file tests the C API.
6 6
7 #include "mojo/public/c/system/core.h" 7 #include "mojo/public/c/system/core.h"
8 8
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 TEST(CoreTest, BasicMessagePipe) { 78 TEST(CoreTest, BasicMessagePipe) {
79 MojoHandle h0, h1; 79 MojoHandle h0, h1;
80 MojoWaitFlags wf; 80 MojoWaitFlags wf;
81 char buffer[10] = { 0 }; 81 char buffer[10] = { 0 };
82 uint32_t buffer_size; 82 uint32_t buffer_size;
83 83
84 h0 = MOJO_HANDLE_INVALID; 84 h0 = MOJO_HANDLE_INVALID;
85 h1 = MOJO_HANDLE_INVALID; 85 h1 = MOJO_HANDLE_INVALID;
86 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(&h0, &h1)); 86 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &h0, &h1));
87 EXPECT_NE(h0, MOJO_HANDLE_INVALID); 87 EXPECT_NE(h0, MOJO_HANDLE_INVALID);
88 EXPECT_NE(h1, MOJO_HANDLE_INVALID); 88 EXPECT_NE(h1, MOJO_HANDLE_INVALID);
89 89
90 // Shouldn't be readable. 90 // Shouldn't be readable.
91 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, 91 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED,
92 MojoWait(h0, MOJO_WAIT_FLAG_READABLE, 0)); 92 MojoWait(h0, MOJO_WAIT_FLAG_READABLE, 0));
93 93
94 // Should be writable. 94 // Should be writable.
95 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(h0, MOJO_WAIT_FLAG_WRITABLE, 0)); 95 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(h0, MOJO_WAIT_FLAG_WRITABLE, 0));
96 96
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // This checks that things actually work in C (not C++). 275 // This checks that things actually work in C (not C++).
276 TEST(CoreTest, MinimalCTest) { 276 TEST(CoreTest, MinimalCTest) {
277 const char* failure = MinimalCTest(); 277 const char* failure = MinimalCTest();
278 EXPECT_TRUE(failure == NULL) << failure; 278 EXPECT_TRUE(failure == NULL) << failure;
279 } 279 }
280 280
281 // TODO(vtl): Add multi-threaded tests. 281 // TODO(vtl): Add multi-threaded tests.
282 282
283 } // namespace 283 } // namespace
284 } // namespace mojo 284 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/core_perftest.cc ('k') | mojo/public/c/system/tests/core_unittest_pure_c.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698