Backed out changeset 4527bd35cc4e (bug 1331718)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 10 May 2017 12:09:06 +0200
changeset 357482 a905bc2236110c9cffcd87587f78cf3482902b03
parent 357481 b6b4f7e46f4596d6666c0f7536ab54097db295d4
child 357483 59688757b4ba961b7ad42843efe256ff062a5977
push id31792
push usercbook@mozilla.com
push dateWed, 10 May 2017 13:07:59 +0000
treeherdermozilla-central@ebbcdaa5b580 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1331718
milestone55.0a1
backs out4527bd35cc4e6b20c77ec2378581529efd2425c5
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 4527bd35cc4e (bug 1331718)
mfbt/tests/TestSmallPointerArray.cpp
mfbt/tests/moz.build
deleted file mode 100644
--- a/mfbt/tests/TestSmallPointerArray.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/SmallPointerArray.h"
-
-#define PTR1 (void*)0x4
-#define PTR2 (void*)0x5
-#define PTR3 (void*)0x6
-
-// We explicitly test sizes up to 3 here, as that is when SmallPointerArray<>
-// switches to the storage method used for larger arrays.
-void TestArrayManipulation()
-{
-  using namespace mozilla;
-  SmallPointerArray<void> testArray;
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 0);
-  MOZ_RELEASE_ASSERT(sizeof(testArray) == 2 * sizeof(void*));
-
-  testArray.AppendElement(PTR1);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-
-  testArray.AppendElement(PTR2);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 2);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-  MOZ_RELEASE_ASSERT(testArray[1] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR2);
-
-  testArray.RemoveElement(PTR1);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
-
-  testArray.AppendElement(PTR1);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 2);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
-  MOZ_RELEASE_ASSERT(testArray[1] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR1);
-
-  testArray.AppendElement(PTR3);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 3);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
-  MOZ_RELEASE_ASSERT(testArray[1] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR1);
-  MOZ_RELEASE_ASSERT(testArray[2] == PTR3);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(2) == PTR3);
-
-  testArray.RemoveElement(PTR1);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 2);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
-  MOZ_RELEASE_ASSERT(testArray[1] == PTR3);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR3);
-
-  testArray.RemoveElement(PTR2);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR3);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR3);
-
-  testArray.RemoveElement(PTR3);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 0);
-
-  testArray.Clear();
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 0);
-
-  testArray.AppendElement(PTR1);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-
-  testArray.AppendElement(PTR2);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 2);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-  MOZ_RELEASE_ASSERT(testArray[1] == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR2);
-
-  testArray.RemoveElement(PTR2);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-
-  testArray.RemoveElement(PTR3);
-
-  MOZ_RELEASE_ASSERT(testArray.Length() == 1);
-  MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-}
-
-void TestRangeBasedLoops()
-{
-  using namespace mozilla;
-  SmallPointerArray<void> testArray;
-  void* verification[3];
-  uint32_t entries = 0;
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 0);
-
-  testArray.AppendElement(PTR1);
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 1);
-  MOZ_RELEASE_ASSERT(verification[0] == PTR1);
-
-  entries = 0;
-
-  testArray.AppendElement(PTR2);
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 2);
-  MOZ_RELEASE_ASSERT(verification[0] == PTR1);
-  MOZ_RELEASE_ASSERT(verification[1] == PTR2);
-
-  entries = 0;
-
-  testArray.RemoveElement(PTR1);
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 1);
-  MOZ_RELEASE_ASSERT(verification[0] == PTR2);
-
-  entries = 0;
-
-  testArray.AppendElement(PTR1);
-  testArray.AppendElement(PTR3);
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 3);
-  MOZ_RELEASE_ASSERT(verification[0] == PTR2);
-  MOZ_RELEASE_ASSERT(verification[1] == PTR1);
-  MOZ_RELEASE_ASSERT(verification[2] == PTR3);
-
-  entries = 0;
-
-  testArray.RemoveElement(PTR1);
-  testArray.RemoveElement(PTR2);
-  testArray.RemoveElement(PTR3);
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 0);
-
-  testArray.Clear();
-
-  for (void* test : testArray) {
-    verification[entries++] = test;
-  }
-
-  MOZ_RELEASE_ASSERT(entries == 0);
-}
-
-int
-main()
-{
-  TestArrayManipulation();
-  TestRangeBasedLoops();
-  return 0;
-}
--- a/mfbt/tests/moz.build
+++ b/mfbt/tests/moz.build
@@ -41,17 +41,16 @@ CppUnitTests([
     'TestRange',
     'TestRefPtr',
     'TestResult',
     'TestRollingMean',
     'TestSaturate',
     'TestScopeExit',
     'TestSegmentedVector',
     'TestSHA1',
-    'TestSmallPointerArray',
     'TestSplayTree',
     'TestTemplateLib',
     'TestTuple',
     'TestTypedEnum',
     'TestTypeTraits',
     'TestUniquePtr',
     'TestVariant',
     'TestVector',