From ceeb4976a531646f84d4c37d0ac4abcaccc74c22 Mon Sep 17 00:00:00 2001 From: "anujk.sharma" Date: Wed, 21 Jan 2015 12:39:00 -0800 Subject: Adding "static_assert" in lieu of "COMPILE_ASSERT" in google_apis module All our toolchains support c++'s static_assert now- COMPILE_ASSERT can be removed now. BUG=442514 Review URL: https://codereview.chromium.org/860983003 Cr-Commit-Position: refs/heads/master@{#312436} --- google_apis/gcm/base/mcs_util.cc | 4 ++-- google_apis/gcm/base/mcs_util_unittest.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'google_apis/gcm') diff --git a/google_apis/gcm/base/mcs_util.cc b/google_apis/gcm/base/mcs_util.cc index ceccc95..7dd9d7b 100644 --- a/google_apis/gcm/base/mcs_util.cc +++ b/google_apis/gcm/base/mcs_util.cc @@ -36,8 +36,8 @@ const char* kProtoNames[] = { "mcs_proto.BindAccountResponse", "mcs_proto.TalkMetadata" }; -COMPILE_ASSERT(arraysize(kProtoNames) == kNumProtoTypes, - ProtoNamesMustIncludeAllTags); +static_assert(arraysize(kProtoNames) == kNumProtoTypes, + "Proto Names Must Include All Tags"); const char kLoginId[] = "chrome-"; const char kLoginDomain[] = "mcs.android.com"; diff --git a/google_apis/gcm/base/mcs_util_unittest.cc b/google_apis/gcm/base/mcs_util_unittest.cc index 00bac11..d51f5a07 100644 --- a/google_apis/gcm/base/mcs_util_unittest.cc +++ b/google_apis/gcm/base/mcs_util_unittest.cc @@ -42,7 +42,7 @@ TEST(MCSUtilTest, ProtobufToTag) { // Test getting and setting persistent ids. TEST(MCSUtilTest, PersistentIds) { - COMPILE_ASSERT(kNumProtoTypes == 16U, UpdatePersistentIds); + static_assert(kNumProtoTypes == 16U, "Update Persistent Ids"); const int kTagsWithPersistentIds[] = { kIqStanzaTag, kDataMessageStanzaTag @@ -61,7 +61,7 @@ TEST(MCSUtilTest, PersistentIds) { // Test getting and setting stream ids. TEST(MCSUtilTest, StreamIds) { - COMPILE_ASSERT(kNumProtoTypes == 16U, UpdateStreamIds); + static_assert(kNumProtoTypes == 16U, "Update Stream Ids"); const int kTagsWithStreamIds[] = { kIqStanzaTag, kDataMessageStanzaTag, -- cgit v1.1