summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 13:23:23 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-28 13:23:23 +0000
commit2fb8c53c9df2604b691f754f2e9f678a2d093221 (patch)
tree4c2da06e5dd4e4e04e3b15b9a94ee0f707b5793f /mojo
parent992d2c81e7f412fb652de4f4cbd5a8aac5d56cd7 (diff)
downloadchromium_src-2fb8c53c9df2604b691f754f2e9f678a2d093221.zip
chromium_src-2fb8c53c9df2604b691f754f2e9f678a2d093221.tar.gz
chromium_src-2fb8c53c9df2604b691f754f2e9f678a2d093221.tar.bz2
Mojo: Split off the C++ parts of mojo/public/c/system macros.h to their own file.
(Also split the tests.) R=darin@chromium.org Review URL: https://codereview.chromium.org/216073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r--mojo/apps/js/main.cc2
-rw-r--r--mojo/examples/aura_demo/aura_demo.cc3
-rw-r--r--mojo/examples/compositor_app/compositor_app.cc3
-rw-r--r--mojo/examples/launcher/launcher.cc3
-rw-r--r--mojo/examples/sample_app/sample_app.cc4
-rw-r--r--mojo/examples/view_manager/view_manager.cc3
-rw-r--r--mojo/mojo_public.gypi4
-rw-r--r--mojo/public/bindings/allocation_scope.h2
-rw-r--r--mojo/public/bindings/lib/buffer.cc2
-rw-r--r--mojo/public/bindings/lib/fixed_buffer.h2
-rw-r--r--mojo/public/bindings/lib/message_queue.h2
-rw-r--r--mojo/public/bindings/lib/scratch_buffer.h2
-rw-r--r--mojo/public/bindings/remote_ptr.h2
-rw-r--r--mojo/public/bindings/tests/connector_unittest.cc2
-rw-r--r--mojo/public/bindings/tests/router_unittest.cc2
-rw-r--r--mojo/public/c/system/macros.h50
-rw-r--r--mojo/public/c/tests/system/core_perftest.cc2
-rw-r--r--mojo/public/c/tests/system/macros_unittest.cc48
-rw-r--r--mojo/public/cpp/system/core.h2
-rw-r--r--mojo/public/cpp/system/macros.h53
-rw-r--r--mojo/public/cpp/tests/system/core_unittest.cc2
-rw-r--r--mojo/public/cpp/tests/system/macros_unittest.cc (renamed from mojo/public/tests/system/macros_unittest.cc)43
-rw-r--r--mojo/public/environment/environment.h2
-rw-r--r--mojo/public/environment/tests/async_waiter_unittest.cc2
-rw-r--r--mojo/public/tests/system/DEPS3
-rw-r--r--mojo/public/utility/lib/thread_local.h2
-rw-r--r--mojo/public/utility/mutex.h2
-rw-r--r--mojo/public/utility/tests/mutex_unittest.cc2
-rw-r--r--mojo/public/utility/tests/thread_unittest.cc2
-rw-r--r--mojo/public/utility/thread.h2
30 files changed, 142 insertions, 113 deletions
diff --git a/mojo/apps/js/main.cc b/mojo/apps/js/main.cc
index c7b32b5..a712c2a 100644
--- a/mojo/apps/js/main.cc
+++ b/mojo/apps/js/main.cc
@@ -5,8 +5,8 @@
#include "base/message_loop/message_loop.h"
#include "gin/public/isolate_holder.h"
#include "mojo/apps/js/mojo_runner_delegate.h"
-#include "mojo/public/c/system/macros.h"
#include "mojo/public/cpp/system/core.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/gles2/gles2_cpp.h"
#if defined(WIN32)
diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc
index be9b144..0b5391d 100644
--- a/mojo/examples/aura_demo/aura_demo.cc
+++ b/mojo/examples/aura_demo/aura_demo.cc
@@ -11,8 +11,7 @@
#include "mojo/examples/aura_demo/demo_screen.h"
#include "mojo/examples/aura_demo/window_tree_host_mojo.h"
#include "mojo/public/bindings/allocation_scope.h"
-#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/core.h"
#include "mojo/public/gles2/gles2_cpp.h"
#include "mojo/public/shell/application.h"
#include "mojo/public/shell/shell.mojom.h"
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc
index 5120f5e..75ca06f 100644
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ b/mojo/examples/compositor_app/compositor_app.cc
@@ -10,8 +10,7 @@
#include "mojo/examples/compositor_app/compositor_host.h"
#include "mojo/public/bindings/allocation_scope.h"
#include "mojo/public/bindings/remote_ptr.h"
-#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/core.h"
#include "mojo/public/gles2/gles2_cpp.h"
#include "mojo/public/shell/application.h"
#include "mojo/public/shell/shell.mojom.h"
diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
index 0817e4c..310d526 100644
--- a/mojo/examples/launcher/launcher.cc
+++ b/mojo/examples/launcher/launcher.cc
@@ -17,8 +17,7 @@
#include "mojo/examples/launcher/launcher.mojom.h"
#include "mojo/public/bindings/allocation_scope.h"
#include "mojo/public/bindings/remote_ptr.h"
-#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/core.h"
#include "mojo/public/gles2/gles2_cpp.h"
#include "mojo/public/shell/application.h"
#include "mojo/public/shell/shell.mojom.h"
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index a6cc649..cf7bcb8 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -8,8 +8,8 @@
#include "mojo/examples/sample_app/gles2_client_impl.h"
#include "mojo/public/bindings/allocation_scope.h"
#include "mojo/public/bindings/remote_ptr.h"
-#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/core.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/environment/environment.h"
#include "mojo/public/gles2/gles2_cpp.h"
#include "mojo/public/shell/application.h"
diff --git a/mojo/examples/view_manager/view_manager.cc b/mojo/examples/view_manager/view_manager.cc
index 938d4a5..7560f93 100644
--- a/mojo/examples/view_manager/view_manager.cc
+++ b/mojo/examples/view_manager/view_manager.cc
@@ -12,8 +12,7 @@
#include "mojo/examples/view_manager/view_manager.mojom.h"
#include "mojo/public/bindings/allocation_scope.h"
#include "mojo/public/bindings/remote_ptr.h"
-#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/core.h"
#include "mojo/public/shell/application.h"
#include "mojo/public/shell/shell.mojom.h"
#include "mojo/services/native_viewport/geometry_conversions.h"
diff --git a/mojo/mojo_public.gypi b/mojo/mojo_public.gypi
index 2bb9057..71eda7b 100644
--- a/mojo/mojo_public.gypi
+++ b/mojo/mojo_public.gypi
@@ -20,6 +20,7 @@
'public/c/system/macros.h',
'public/c/system/system_export.h',
'public/cpp/system/core.h',
+ 'public/cpp/system/macros.h',
'public/system/core_private.cc',
'public/system/core_private.h',
],
@@ -193,8 +194,9 @@
'sources': [
'public/c/tests/system/core_unittest.cc',
'public/c/tests/system/core_unittest_pure_c.c',
+ 'public/c/tests/system/macros_unittest.cc',
'public/cpp/tests/system/core_unittest.cc',
- 'public/tests/system/macros_unittest.cc',
+ 'public/cpp/tests/system/macros_unittest.cc',
],
},
{
diff --git a/mojo/public/bindings/allocation_scope.h b/mojo/public/bindings/allocation_scope.h
index 8df95c0..05737b9 100644
--- a/mojo/public/bindings/allocation_scope.h
+++ b/mojo/public/bindings/allocation_scope.h
@@ -6,7 +6,7 @@
#define MOJO_PUBLIC_BINDINGS_ALLOCATION_SCOPE_H_
#include "mojo/public/bindings/lib/scratch_buffer.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/bindings/lib/buffer.cc b/mojo/public/bindings/lib/buffer.cc
index 30368a7..c77ec80 100644
--- a/mojo/public/bindings/lib/buffer.cc
+++ b/mojo/public/bindings/lib/buffer.cc
@@ -6,7 +6,7 @@
#include <assert.h>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/environment/buffer_tls.h"
namespace mojo {
diff --git a/mojo/public/bindings/lib/fixed_buffer.h b/mojo/public/bindings/lib/fixed_buffer.h
index 41ab86d..7f25c0e 100644
--- a/mojo/public/bindings/lib/fixed_buffer.h
+++ b/mojo/public/bindings/lib/fixed_buffer.h
@@ -6,7 +6,7 @@
#define MOJO_PUBLIC_BINDINGS_LIB_FIXED_BUFFER_H_
#include "mojo/public/bindings/buffer.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
namespace internal {
diff --git a/mojo/public/bindings/lib/message_queue.h b/mojo/public/bindings/lib/message_queue.h
index 3b59c2c..d1c535b 100644
--- a/mojo/public/bindings/lib/message_queue.h
+++ b/mojo/public/bindings/lib/message_queue.h
@@ -7,7 +7,7 @@
#include <queue>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
class Message;
diff --git a/mojo/public/bindings/lib/scratch_buffer.h b/mojo/public/bindings/lib/scratch_buffer.h
index bc40591..337375a0 100644
--- a/mojo/public/bindings/lib/scratch_buffer.h
+++ b/mojo/public/bindings/lib/scratch_buffer.h
@@ -8,7 +8,7 @@
#include <deque>
#include "mojo/public/bindings/buffer.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
namespace internal {
diff --git a/mojo/public/bindings/remote_ptr.h b/mojo/public/bindings/remote_ptr.h
index 5775dd7..4e1ef25 100644
--- a/mojo/public/bindings/remote_ptr.h
+++ b/mojo/public/bindings/remote_ptr.h
@@ -9,7 +9,7 @@
#include "mojo/public/bindings/interface.h"
#include "mojo/public/bindings/lib/router.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/bindings/tests/connector_unittest.cc b/mojo/public/bindings/tests/connector_unittest.cc
index 3911759..cf94d1d 100644
--- a/mojo/public/bindings/tests/connector_unittest.cc
+++ b/mojo/public/bindings/tests/connector_unittest.cc
@@ -8,7 +8,7 @@
#include "mojo/public/bindings/lib/connector.h"
#include "mojo/public/bindings/lib/message_builder.h"
#include "mojo/public/bindings/lib/message_queue.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/environment/environment.h"
#include "mojo/public/utility/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/bindings/tests/router_unittest.cc b/mojo/public/bindings/tests/router_unittest.cc
index dee9dd9..11a4136 100644
--- a/mojo/public/bindings/tests/router_unittest.cc
+++ b/mojo/public/bindings/tests/router_unittest.cc
@@ -8,7 +8,7 @@
#include "mojo/public/bindings/lib/message_builder.h"
#include "mojo/public/bindings/lib/message_queue.h"
#include "mojo/public/bindings/lib/router.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/environment/environment.h"
#include "mojo/public/utility/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h
index d89ca02..4be0249 100644
--- a/mojo/public/c/system/macros.h
+++ b/mojo/public/c/system/macros.h
@@ -26,58 +26,14 @@
#define MOJO_WARN_UNUSED_RESULT
#endif
-// C++-only macros -------------------------------------------------------------
-
+// This macro is currently C++-only, but we want to use it in the C core.h.
#ifdef __cplusplus
-
-// Annotate a virtual method indicating it must be overriding a virtual method
-// in the parent class. Use like:
-// virtual void foo() OVERRIDE;
-#if defined(_MSC_VER) || defined(__clang__)
-#define MOJO_OVERRIDE override
-#else
-#define MOJO_OVERRIDE
-#endif
-
-// A macro to disallow the copy constructor and operator= functions.
-// This should be used in the private: declarations for a class.
-#define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
-
// Used to assert things at compile time.
namespace mojo { template <bool> struct CompileAssert {}; }
#define MOJO_COMPILE_ASSERT(expr, msg) \
typedef ::mojo::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
-
-// Used to calculate the number of elements in an array.
-// (See |arraysize()| in Chromium's base/basictypes.h for more details.)
-namespace mojo {
-template <typename T, size_t N>
-char (&ArraySizeHelper(T (&array)[N]))[N];
-#if !defined(_MSC_VER)
-template <typename T, size_t N>
-char (&ArraySizeHelper(const T (&array)[N]))[N];
+#else
+#define MOJO_COMPILE_ASSERT(expr, msg)
#endif
-} // namespace mojo
-#define MOJO_ARRAYSIZE(array) (sizeof(::mojo::ArraySizeHelper(array)))
-
-// Used to make a type move-only in C++03. See Chromium's base/move.h for more
-// details.
-#define MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
- private: \
- struct rvalue_type { \
- explicit rvalue_type(type* object) : object(object) {} \
- type* object; \
- }; \
- type(type&); \
- void operator=(type&); \
- public: \
- operator rvalue_type() { return rvalue_type(this); } \
- type Pass() { return type(rvalue_type(this)); } \
- typedef void MoveOnlyTypeForCPP03; \
- private:
-
-#endif // __cplusplus
#endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_
diff --git a/mojo/public/c/tests/system/core_perftest.cc b/mojo/public/c/tests/system/core_perftest.cc
index 53ac6b8..0d2f411 100644
--- a/mojo/public/c/tests/system/core_perftest.cc
+++ b/mojo/public/c/tests/system/core_perftest.cc
@@ -11,7 +11,7 @@
#include <stdint.h>
#include <stdio.h>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/tests/test_support.h"
#include "mojo/public/tests/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/c/tests/system/macros_unittest.cc b/mojo/public/c/tests/system/macros_unittest.cc
new file mode 100644
index 0000000..5225b67
--- /dev/null
+++ b/mojo/public/c/tests/system/macros_unittest.cc
@@ -0,0 +1,48 @@
+// 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): Fix no-compile tests (which are all disabled; crbug.com/105388)
+// and write some "negative" tests.
+
+#include "mojo/public/c/system/macros.h"
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace {
+
+TEST(MacrosTest, AllowUnused) {
+ // Test that no warning/error is issued even though |x| is unused.
+ int x MOJO_ALLOW_UNUSED = 123;
+}
+
+int MustUseReturnedResult() MOJO_WARN_UNUSED_RESULT;
+int MustUseReturnedResult() {
+ return 456;
+}
+
+TEST(MacrosTest, WarnUnusedResult) {
+ if (!MustUseReturnedResult())
+ abort();
+}
+
+// First test |MOJO_COMPILE_ASSERT()| in a global scope.
+MOJO_COMPILE_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t),
+ bad_compile_assert_failure_in_global_scope);
+
+TEST(MacrosTest, CompileAssert) {
+ // Then in a local scope.
+ MOJO_COMPILE_ASSERT(sizeof(int32_t) == 2 * sizeof(int16_t),
+ bad_compile_assert_failure);
+}
+
+} // namespace
+} // namespace mojo
diff --git a/mojo/public/cpp/system/core.h b/mojo/public/cpp/system/core.h
index afa9ef4..7022110 100644
--- a/mojo/public/cpp/system/core.h
+++ b/mojo/public/cpp/system/core.h
@@ -11,8 +11,8 @@
#include <limits>
#include "mojo/public/c/system/core.h"
-#include "mojo/public/c/system/macros.h"
#include "mojo/public/c/system/system_export.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/cpp/system/macros.h b/mojo/public/cpp/system/macros.h
new file mode 100644
index 0000000..ac4f3db
--- /dev/null
+++ b/mojo/public/cpp/system/macros.h
@@ -0,0 +1,53 @@
+// Copyright 2013 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.
+
+#ifndef MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
+#define MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
+
+#include "mojo/public/c/system/macros.h"
+
+// Annotate a virtual method indicating it must be overriding a virtual method
+// in the parent class. Use like:
+// virtual void foo() OVERRIDE;
+#if defined(_MSC_VER) || defined(__clang__)
+#define MOJO_OVERRIDE override
+#else
+#define MOJO_OVERRIDE
+#endif
+
+// A macro to disallow the copy constructor and operator= functions.
+// This should be used in the private: declarations for a class.
+#define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+// Used to calculate the number of elements in an array.
+// (See |arraysize()| in Chromium's base/basictypes.h for more details.)
+namespace mojo {
+template <typename T, size_t N>
+char (&ArraySizeHelper(T (&array)[N]))[N];
+#if !defined(_MSC_VER)
+template <typename T, size_t N>
+char (&ArraySizeHelper(const T (&array)[N]))[N];
+#endif
+} // namespace mojo
+#define MOJO_ARRAYSIZE(array) (sizeof(::mojo::ArraySizeHelper(array)))
+
+// Used to make a type move-only in C++03. See Chromium's base/move.h for more
+// details.
+#define MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
+ private: \
+ struct rvalue_type { \
+ explicit rvalue_type(type* object) : object(object) {} \
+ type* object; \
+ }; \
+ type(type&); \
+ void operator=(type&); \
+ public: \
+ operator rvalue_type() { return rvalue_type(this); } \
+ type Pass() { return type(rvalue_type(this)); } \
+ typedef void MoveOnlyTypeForCPP03; \
+ private:
+
+#endif // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
diff --git a/mojo/public/cpp/tests/system/core_unittest.cc b/mojo/public/cpp/tests/system/core_unittest.cc
index 74390ad..5121622 100644
--- a/mojo/public/cpp/tests/system/core_unittest.cc
+++ b/mojo/public/cpp/tests/system/core_unittest.cc
@@ -10,7 +10,7 @@
#include <map>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/tests/system/macros_unittest.cc b/mojo/public/cpp/tests/system/macros_unittest.cc
index 1a4125e..2da1cd6 100644
--- a/mojo/public/tests/system/macros_unittest.cc
+++ b/mojo/public/cpp/tests/system/macros_unittest.cc
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file consists of "positive" tests, i.e., those verifying that things
-// work (without compile errors, or even warnings if warnings are treated as
-// errors).
+// 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/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include <assert.h>
#include <stdint.h>
@@ -19,21 +21,6 @@
namespace mojo {
namespace {
-TEST(MacrosTest, AllowUnused) {
- // Test that no warning/error is issued even though |x| is unused.
- int x MOJO_ALLOW_UNUSED = 123;
-}
-
-int MustUseReturnedResult() MOJO_WARN_UNUSED_RESULT;
-int MustUseReturnedResult() {
- return 456;
-}
-
-TEST(MacrosTest, WarnUnusedResult) {
- if (!MustUseReturnedResult())
- abort();
-}
-
// Note: MSVS is very strict (and arguably buggy) about warnings for classes
// defined in a local scope, so define these globally.
struct TestOverrideBaseClass {
@@ -48,7 +35,7 @@ struct TestOverrideSubclass : public TestOverrideBaseClass {
virtual void AlsoToBeOverridden() MOJO_OVERRIDE {}
};
-TEST(MacrosTest, Override) {
+TEST(MacrosCppTest, Override) {
TestOverrideSubclass x;
x.ToBeOverridden();
x.AlsoToBeOverridden();
@@ -66,29 +53,19 @@ class TestDisallowCopyAndAssignClass {
MOJO_DISALLOW_COPY_AND_ASSIGN(TestDisallowCopyAndAssignClass);
};
-TEST(MacrosTest, DisallowCopyAndAssign) {
+TEST(MacrosCppTest, DisallowCopyAndAssign) {
TestDisallowCopyAndAssignClass x;
x.NoOp();
TestDisallowCopyAndAssignClass y(789);
y.NoOp();
}
-// First test |MOJO_COMPILE_ASSERT()| in a global scope.
-MOJO_COMPILE_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t),
- bad_compile_assert_failure_in_global_scope);
-
-TEST(MacrosTest, CompileAssert) {
- // Then in a local scope.
- MOJO_COMPILE_ASSERT(sizeof(int32_t) == 2 * sizeof(int16_t),
- bad_compile_assert_failure);
-}
-
// Test that |MOJO_ARRAYSIZE()| works in a |MOJO_COMPILE_ASSERT()|.
const int kGlobalArray[5] = { 1, 2, 3, 4, 5 };
MOJO_COMPILE_ASSERT(MOJO_ARRAYSIZE(kGlobalArray) == 5u,
mojo_array_size_failed_in_compile_assert);
-TEST(MacrosTest, ArraySize) {
+TEST(MacrosCppTest, ArraySize) {
double local_array[4] = { 6.7, 7.8, 8.9, 9.0 };
EXPECT_EQ(4u, MOJO_ARRAYSIZE(local_array));
}
@@ -125,7 +102,7 @@ class MoveOnlyInt {
int value_;
};
-TEST(MacrosTest, MoveOnlyTypeForCpp03) {
+TEST(MacrosCppTest, MoveOnlyTypeForCpp03) {
MoveOnlyInt x(123);
EXPECT_TRUE(x.is_set());
EXPECT_EQ(123, x.value());
diff --git a/mojo/public/environment/environment.h b/mojo/public/environment/environment.h
index 094aa63..aa6fb51 100644
--- a/mojo/public/environment/environment.h
+++ b/mojo/public/environment/environment.h
@@ -5,7 +5,7 @@
#ifndef MOJO_PUBLIC_ENVIRONMENT_ENVIRONMENT_H_
#define MOJO_PUBLIC_ENVIRONMENT_ENVIRONMENT_H_
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/environment/tests/async_waiter_unittest.cc b/mojo/public/environment/tests/async_waiter_unittest.cc
index 2931b29..07522e7 100644
--- a/mojo/public/environment/tests/async_waiter_unittest.cc
+++ b/mojo/public/environment/tests/async_waiter_unittest.cc
@@ -4,8 +4,8 @@
#include <string>
-#include "mojo/public/c/system/macros.h"
#include "mojo/public/cpp/system/core.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/environment/default_async_waiter.h"
#include "mojo/public/environment/environment.h"
#include "mojo/public/tests/test_utils.h"
diff --git a/mojo/public/tests/system/DEPS b/mojo/public/tests/system/DEPS
deleted file mode 100644
index 6c53bc2..0000000
--- a/mojo/public/tests/system/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+testing",
-]
diff --git a/mojo/public/utility/lib/thread_local.h b/mojo/public/utility/lib/thread_local.h
index 176f7d4..6cb75e1 100644
--- a/mojo/public/utility/lib/thread_local.h
+++ b/mojo/public/utility/lib/thread_local.h
@@ -9,7 +9,7 @@
#include <pthread.h>
#endif
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
namespace internal {
diff --git a/mojo/public/utility/mutex.h b/mojo/public/utility/mutex.h
index 445647a..7928694 100644
--- a/mojo/public/utility/mutex.h
+++ b/mojo/public/utility/mutex.h
@@ -11,7 +11,7 @@
#include <pthread.h>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/utility/tests/mutex_unittest.cc b/mojo/public/utility/tests/mutex_unittest.cc
index 171dba8..acbcff6 100644
--- a/mojo/public/utility/tests/mutex_unittest.cc
+++ b/mojo/public/utility/tests/mutex_unittest.cc
@@ -9,7 +9,7 @@
#include <vector>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/utility/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/utility/tests/thread_unittest.cc b/mojo/public/utility/tests/thread_unittest.cc
index 0f1a75f..094b192 100644
--- a/mojo/public/utility/tests/thread_unittest.cc
+++ b/mojo/public/utility/tests/thread_unittest.cc
@@ -4,7 +4,7 @@
#include "mojo/public/utility/thread.h"
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/utility/thread.h b/mojo/public/utility/thread.h
index a1ebc6c..a527db7 100644
--- a/mojo/public/utility/thread.h
+++ b/mojo/public/utility/thread.h
@@ -12,7 +12,7 @@
#include <pthread.h>
#include <stddef.h>
-#include "mojo/public/c/system/macros.h"
+#include "mojo/public/cpp/system/macros.h"
namespace mojo {