Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / mojo / system / memory_unittest.cc
index 5cfcb32..74bcf11 100644 (file)
@@ -169,14 +169,14 @@ TEST(MemoryTest, InvalidDeath) {
   // implementation.
 
   // These tests depend on |int32_t| and |int64_t| having nontrivial alignment.
-  MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int32_t) != 1,
-                      int32_t_does_not_have_to_be_aligned);
-  MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) != 1,
-                      int64_t_does_not_have_to_be_aligned);
+  static_assert(MOJO_ALIGNOF(int32_t) != 1,
+                "int32_t does not require nontrivial alignment");
+  static_assert(MOJO_ALIGNOF(int64_t) != 1,
+                "int64_t does not require nontrivial alignment");
 
   // Null:
   {
-    UserPointer<char> ptr(NULL);
+    UserPointer<char> ptr(nullptr);
     char array[5] = {};
     EXPECT_DEATH_IF_SUPPORTED(ptr.Check(), kMemoryCheckFailedRegex);
     EXPECT_DEATH_IF_SUPPORTED(ptr.Get(), kMemoryCheckFailedRegex);
@@ -186,7 +186,7 @@ TEST(MemoryTest, InvalidDeath) {
     EXPECT_DEATH_IF_SUPPORTED(ptr.PutArray(array, 5), kMemoryCheckFailedRegex);
   }
   {
-    UserPointer<int32_t> ptr(NULL);
+    UserPointer<int32_t> ptr(nullptr);
     int32_t array[5] = {};
     EXPECT_DEATH_IF_SUPPORTED(ptr.Check(), kMemoryCheckFailedRegex);
     EXPECT_DEATH_IF_SUPPORTED(ptr.Get(), kMemoryCheckFailedRegex);
@@ -196,7 +196,7 @@ TEST(MemoryTest, InvalidDeath) {
     EXPECT_DEATH_IF_SUPPORTED(ptr.PutArray(array, 5), kMemoryCheckFailedRegex);
   }
   {
-    UserPointer<int64_t> ptr(NULL);
+    UserPointer<int64_t> ptr(nullptr);
     int64_t array[5] = {};
     EXPECT_DEATH_IF_SUPPORTED(ptr.Check(), kMemoryCheckFailedRegex);
     EXPECT_DEATH_IF_SUPPORTED(ptr.Get(), kMemoryCheckFailedRegex);
@@ -207,7 +207,7 @@ TEST(MemoryTest, InvalidDeath) {
   }
   // Also check a const pointer:
   {
-    UserPointer<const int32_t> ptr(NULL);
+    UserPointer<const int32_t> ptr(nullptr);
     int32_t array[5] = {};
     EXPECT_DEATH_IF_SUPPORTED(ptr.Check(), kMemoryCheckFailedRegex);
     EXPECT_DEATH_IF_SUPPORTED(ptr.Get(), kMemoryCheckFailedRegex);