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

Unified Diff: mojo/public/c/tests/result_unittest.cc

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/tests/macros_unittest.cc ('k') | mojo/public/c/tests/system/buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/tests/result_unittest.cc
diff --git a/mojo/public/c/tests/result_unittest.cc b/mojo/public/c/tests/result_unittest.cc
deleted file mode 100644
index cb16dfe7f1a9e2d91a32f87aad74e74591013ac3..0000000000000000000000000000000000000000
--- a/mojo/public/c/tests/result_unittest.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file tests the C result API (the macros declared in
-// mojo/public/c/include/mojo/result.h).
-
-#include <mojo/result.h>
-
-#include "gtest/gtest.h"
-
-namespace {
-
-TEST(ResultTest, Macros) {
- EXPECT_EQ(0x12345678u, MOJO_RESULT_MAKE(static_cast<MojoResult>(0x8u),
- static_cast<MojoResult>(0x1234u),
- static_cast<MojoResult>(0x567u)));
- EXPECT_EQ(0x8u, MOJO_RESULT_GET_CODE(static_cast<MojoResult>(0x12345678u)));
- EXPECT_EQ(0x1234u,
- MOJO_RESULT_GET_SPACE(static_cast<MojoResult>(0x12345678u)));
- EXPECT_EQ(0x567u,
- MOJO_RESULT_GET_SUBCODE(static_cast<MojoResult>(0x12345678u)));
-
- EXPECT_EQ(0xfedcfedfu, MOJO_RESULT_MAKE(static_cast<MojoResult>(0xfu),
- static_cast<MojoResult>(0xfedcu),
- static_cast<MojoResult>(0xfedu)));
- EXPECT_EQ(0xfu, MOJO_RESULT_GET_CODE(static_cast<MojoResult>(0xfedcfedfu)));
- EXPECT_EQ(0xfedcu,
- MOJO_RESULT_GET_SPACE(static_cast<MojoResult>(0xfedcfedfu)));
- EXPECT_EQ(0xfedu,
- MOJO_RESULT_GET_SUBCODE(static_cast<MojoResult>(0xfedcfedfu)));
-}
-
-TEST(ResultTest, CompleteResultMacros) {
- EXPECT_EQ(0x0u, MOJO_RESULT_OK);
- EXPECT_EQ(0x1u, MOJO_RESULT_CANCELLED);
- EXPECT_EQ(0x2u, MOJO_RESULT_UNKNOWN);
- EXPECT_EQ(0x3u, MOJO_RESULT_INVALID_ARGUMENT);
- EXPECT_EQ(0x4u, MOJO_RESULT_DEADLINE_EXCEEDED);
- EXPECT_EQ(0x5u, MOJO_RESULT_NOT_FOUND);
- EXPECT_EQ(0x6u, MOJO_RESULT_ALREADY_EXISTS);
- EXPECT_EQ(0x7u, MOJO_RESULT_PERMISSION_DENIED);
- EXPECT_EQ(0x8u, MOJO_RESULT_RESOURCE_EXHAUSTED);
- EXPECT_EQ(0x9u, MOJO_RESULT_FAILED_PRECONDITION);
- EXPECT_EQ(0xau, MOJO_RESULT_ABORTED);
- EXPECT_EQ(0xbu, MOJO_RESULT_OUT_OF_RANGE);
- EXPECT_EQ(0xcu, MOJO_RESULT_UNIMPLEMENTED);
- EXPECT_EQ(0xdu, MOJO_RESULT_INTERNAL);
- EXPECT_EQ(0xeu, MOJO_RESULT_UNAVAILABLE);
- EXPECT_EQ(0xfu, MOJO_RESULT_DATA_LOSS);
- EXPECT_EQ(0x0019u, MOJO_RESULT_BUSY);
- EXPECT_EQ(0x001eu, MOJO_RESULT_SHOULD_WAIT);
-}
-
-} // namespace
« no previous file with comments | « mojo/public/c/tests/macros_unittest.cc ('k') | mojo/public/c/tests/system/buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698