OLD | NEW |
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 tests the performance of the C API. | 5 // This tests the performance of the C API. |
6 | 6 |
7 #include "mojo/public/system/core.h" | 7 #include "mojo/public/system/core.h" |
8 | 8 |
9 #include <assert.h> | 9 #include <assert.h> |
10 | 10 |
11 #include "mojo/public/system/macros.h" | 11 #include "mojo/public/system/macros.h" |
12 #include "mojo/public/tests/test_support.h" | 12 #include "mojo/public/tests/test_utils.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class CorePerftest : public testing::Test { | 17 class CorePerftest : public testing::Test { |
18 public: | 18 public: |
19 CorePerftest() : buffer_(NULL), num_bytes_(0) {} | 19 CorePerftest() : buffer_(NULL), num_bytes_(0) {} |
20 virtual ~CorePerftest() {} | 20 virtual ~CorePerftest() {} |
21 | 21 |
22 static void NoOp(void* /*closure*/) { | 22 static void NoOp(void* /*closure*/) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 mojo::test::IterateAndReportPerf("MessagePipe_EmptyRead", | 116 mojo::test::IterateAndReportPerf("MessagePipe_EmptyRead", |
117 &CorePerftest::MessagePipe_EmptyRead, | 117 &CorePerftest::MessagePipe_EmptyRead, |
118 this); | 118 this); |
119 result = MojoClose(h0_); | 119 result = MojoClose(h0_); |
120 assert(result == MOJO_RESULT_OK); | 120 assert(result == MOJO_RESULT_OK); |
121 result = MojoClose(h1_); | 121 result = MojoClose(h1_); |
122 assert(result == MOJO_RESULT_OK); | 122 assert(result == MOJO_RESULT_OK); |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
OLD | NEW |