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

Unified Diff: mojo/public/cpp/system/tests/macros_unittest.cc

Issue 1784743003: [mojo-sdk] Remove mojo_ignore_result and move C++ macros.h to bindings internal code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/system/tests/macros_unittest.cc
diff --git a/mojo/public/cpp/system/tests/macros_unittest.cc b/mojo/public/cpp/system/tests/macros_unittest.cc
deleted file mode 100644
index 30d7c8443910b34fd2e0ae80f4e502de1c56e23e..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/system/tests/macros_unittest.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 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++ Mojo system macros and consists of "positive" tests,
-// i.e., those verifying that things work (without compile errors, or even
-// warnings if warnings are treated as errors).
-// TODO(vtl): Maybe rename "MacrosCppTest" -> "MacrosTest" if/when this gets
-// compiled into a different binary from the C API tests.
-// TODO(vtl): Fix no-compile tests (which are all disabled; crbug.com/105388)
-// and write some "negative" tests.
-
-#include "mojo/public/cpp/system/macros.h"
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <utility>
-
-#include "base/compiler_specific.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojo {
-
-// The test for |MOJO_STATIC_CONST_MEMBER_DEFINITION| is really a compile/link
-// test. To test it fully would really require a header file and multiple .cc
-// files, but we'll just cursorily verify it.
-//
-// This is defined outside of an anonymous namespace because
-// MOJO_STATIC_CONST_MEMBER_DEFINITION may not be used on internal symbols.
-struct StructWithStaticConstMember {
- static const int kStaticConstMember = 123;
-};
-MOJO_STATIC_CONST_MEMBER_DEFINITION
-const int StructWithStaticConstMember::kStaticConstMember;
-
-namespace {
-
-// Note: MSVS is very strict (and arguably buggy) about warnings for classes
-// defined in a local scope, so define these globally.
-struct TestOverrideBaseClass {
- virtual ~TestOverrideBaseClass() {}
- virtual void ToBeOverridden() {}
- virtual void AlsoToBeOverridden() = 0;
-};
-
-struct TestOverrideSubclass : public TestOverrideBaseClass {
- ~TestOverrideSubclass() override {}
- void ToBeOverridden() override {}
- void AlsoToBeOverridden() override {}
-};
-
-TEST(MacrosCppTest, Override) {
- TestOverrideSubclass x;
- x.ToBeOverridden();
- x.AlsoToBeOverridden();
-}
-
-// Use it, to make sure things get linked in and to avoid any warnings about
-// unused things.
-TEST(MacrosCppTest, StaticConstMemberDefinition) {
- EXPECT_EQ(123, StructWithStaticConstMember::kStaticConstMember);
-}
-
-} // namespace
-} // namespace mojo
« no previous file with comments | « mojo/public/cpp/system/tests/core_unittest.cc ('k') | mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698