Start preparing test/cctest for jumbo compilation

* Avoid "using namespace" statements, which trigger clang's -Wheader-hygiene
  warnings in jumbo builds.
* Undefine created macros at the end of source files.

BUG=chromium:746958

Change-Id: I5d25432c314437f607b0e1be22765a6764267ba6
Reviewed-on: https://chromium-review.googlesource.com/610962
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#47347}
This commit is contained in:
Mostyn Bramley-Moore 2017-08-11 13:22:28 +02:00 committed by Commit Bot
parent 4c503b65d9
commit cddbe282c6
56 changed files with 348 additions and 153 deletions

View File

@ -12,6 +12,7 @@
namespace v8 {
namespace internal {
namespace compiler {
namespace node {
#define NONE reinterpret_cast<Node*>(1)
@ -875,6 +876,11 @@ TEST(AppendAndTrim) {
}
}
#undef NONE
#undef CHECK_USES
#undef CHECK_INPUTS
} // namespace node
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -281,6 +281,9 @@ TEST(Operator_CountsOrder) {
CHECK_EQ(66, op.ControlOutputCount());
}
#undef NONE
#undef FOLD
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -15,7 +15,6 @@
#include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h"
using namespace v8::base;
namespace {
template <typename Type>

View File

@ -17,7 +17,6 @@
#include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h"
using namespace v8::base;
namespace v8 {
namespace internal {
@ -535,7 +534,7 @@ TEST(RunInt64AddWithOverflowP) {
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(j) {
int64_t expected_val;
int expected_ovf = bits::SignedAddOverflow64(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedAddOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, bt.call(*i, *j));
CHECK_EQ(expected_val, actual_val);
}
@ -554,7 +553,8 @@ TEST(RunInt64AddWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
FOR_INT64_INPUTS(j) {
int expected_ovf = bits::SignedAddOverflow64(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedAddOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -567,7 +567,8 @@ TEST(RunInt64AddWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
FOR_INT64_INPUTS(j) {
int expected_ovf = bits::SignedAddOverflow64(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedAddOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -580,7 +581,7 @@ TEST(RunInt64AddWithOverflowImm) {
Node* ovf = m.Projection(1, add);
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
int expected_ovf = bits::SignedAddOverflow64(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedAddOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call());
CHECK_EQ(expected_val, actual_val);
}
@ -606,7 +607,7 @@ TEST(RunInt64AddWithOverflowInBranchP) {
FOR_INT64_INPUTS(j) {
int32_t expected = constant;
int64_t result;
if (!bits::SignedAddOverflow64(*i, *j, &result)) {
if (!base::bits::SignedAddOverflow64(*i, *j, &result)) {
expected = static_cast<int32_t>(result);
}
CHECK_EQ(expected, bt.call(*i, *j));
@ -627,7 +628,7 @@ TEST(RunInt64SubWithOverflowP) {
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(j) {
int64_t expected_val;
int expected_ovf = bits::SignedSubOverflow64(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedSubOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, bt.call(*i, *j));
CHECK_EQ(expected_val, actual_val);
}
@ -646,7 +647,8 @@ TEST(RunInt64SubWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
FOR_INT64_INPUTS(j) {
int expected_ovf = bits::SignedSubOverflow64(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedSubOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -659,7 +661,8 @@ TEST(RunInt64SubWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
FOR_INT64_INPUTS(j) {
int expected_ovf = bits::SignedSubOverflow64(*j, *i, &expected_val);
int expected_ovf =
base::bits::SignedSubOverflow64(*j, *i, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -672,7 +675,7 @@ TEST(RunInt64SubWithOverflowImm) {
Node* ovf = m.Projection(1, add);
m.StoreToPointer(&actual_val, MachineRepresentation::kWord64, val);
m.Return(ovf);
int expected_ovf = bits::SignedSubOverflow64(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedSubOverflow64(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call());
CHECK_EQ(expected_val, actual_val);
}
@ -698,7 +701,7 @@ TEST(RunInt64SubWithOverflowInBranchP) {
FOR_INT64_INPUTS(j) {
int32_t expected = constant;
int64_t result;
if (!bits::SignedSubOverflow64(*i, *j, &result)) {
if (!base::bits::SignedSubOverflow64(*i, *j, &result)) {
expected = static_cast<int32_t>(result);
}
CHECK_EQ(expected, static_cast<int32_t>(bt.call(*i, *j)));
@ -3331,7 +3334,7 @@ TEST(RunWord32RorP) {
RawMachineAssemblerTester<int32_t> m(MachineType::Uint32());
m.Return(m.Word32Ror(m.Parameter(0), m.Int32Constant(shift)));
FOR_UINT32_INPUTS(j) {
int32_t expected = bits::RotateRight32(*j, shift);
int32_t expected = base::bits::RotateRight32(*j, shift);
CHECK_EQ(expected, m.Call(*j));
}
}
@ -3342,7 +3345,7 @@ TEST(RunWord32RorP) {
bt.AddReturn(m.Word32Ror(bt.param0, bt.param1));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = bits::RotateRight32(*i, shift);
uint32_t expected = base::bits::RotateRight32(*i, shift);
CHECK_EQ(expected, bt.call(*i, shift));
}
}
@ -3358,7 +3361,7 @@ TEST(RunWord32RorInComparison) {
m.Word32Equal(m.Word32Ror(bt.param0, bt.param1), m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
uint32_t expected = 0 == base::bits::RotateRight32(*i, shift);
CHECK_EQ(expected, bt.call(*i, shift));
}
}
@ -3370,7 +3373,7 @@ TEST(RunWord32RorInComparison) {
m.Word32Equal(m.Int32Constant(0), m.Word32Ror(bt.param0, bt.param1)));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
uint32_t expected = 0 == base::bits::RotateRight32(*i, shift);
CHECK_EQ(expected, bt.call(*i, shift));
}
}
@ -3382,7 +3385,7 @@ TEST(RunWord32RorInComparison) {
m.Word32Equal(m.Int32Constant(0),
m.Word32Ror(m.Parameter(0), m.Int32Constant(shift))));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
uint32_t expected = 0 == base::bits::RotateRight32(*i, shift);
CHECK_EQ(expected, m.Call(*i));
}
}
@ -3394,7 +3397,7 @@ TEST(RunWord32RorInComparison) {
m.Word32Equal(m.Word32Ror(m.Parameter(0), m.Int32Constant(shift)),
m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
uint32_t expected = 0 == base::bits::RotateRight32(*i, shift);
CHECK_EQ(expected, m.Call(*i));
}
}
@ -5266,7 +5269,7 @@ TEST(RunInt32AddWithOverflowP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected_val;
int expected_ovf = bits::SignedAddOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedAddOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, bt.call(*i, *j));
CHECK_EQ(expected_val, actual_val);
}
@ -5285,7 +5288,8 @@ TEST(RunInt32AddWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedAddOverflow32(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedAddOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -5298,7 +5302,8 @@ TEST(RunInt32AddWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedAddOverflow32(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedAddOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -5311,7 +5316,7 @@ TEST(RunInt32AddWithOverflowImm) {
Node* ovf = m.Projection(1, add);
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
int expected_ovf = bits::SignedAddOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedAddOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call());
CHECK_EQ(expected_val, actual_val);
}
@ -5335,7 +5340,8 @@ TEST(RunInt32AddWithOverflowInBranchP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected;
if (bits::SignedAddOverflow32(*i, *j, &expected)) expected = constant;
if (base::bits::SignedAddOverflow32(*i, *j, &expected))
expected = constant;
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@ -5354,7 +5360,7 @@ TEST(RunInt32SubWithOverflowP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected_val;
int expected_ovf = bits::SignedSubOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedSubOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, bt.call(*i, *j));
CHECK_EQ(expected_val, actual_val);
}
@ -5373,7 +5379,8 @@ TEST(RunInt32SubWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedSubOverflow32(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedSubOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -5386,7 +5393,8 @@ TEST(RunInt32SubWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedSubOverflow32(*j, *i, &expected_val);
int expected_ovf =
base::bits::SignedSubOverflow32(*j, *i, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
CHECK_EQ(expected_val, actual_val);
}
@ -5399,7 +5407,7 @@ TEST(RunInt32SubWithOverflowImm) {
Node* ovf = m.Projection(1, add);
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
int expected_ovf = bits::SignedSubOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedSubOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call());
CHECK_EQ(expected_val, actual_val);
}
@ -5423,7 +5431,8 @@ TEST(RunInt32SubWithOverflowInBranchP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected;
if (bits::SignedSubOverflow32(*i, *j, &expected)) expected = constant;
if (base::bits::SignedSubOverflow32(*i, *j, &expected))
expected = constant;
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@ -5441,7 +5450,7 @@ TEST(RunInt32MulWithOverflowP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected_val;
int expected_ovf = bits::SignedMulOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedMulOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, bt.call(*i, *j));
if (!expected_ovf) {
CHECK_EQ(expected_val, actual_val);
@ -5461,7 +5470,8 @@ TEST(RunInt32MulWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedMulOverflow32(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedMulOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
if (!expected_ovf) {
CHECK_EQ(expected_val, actual_val);
@ -5476,7 +5486,8 @@ TEST(RunInt32MulWithOverflowImm) {
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
FOR_INT32_INPUTS(j) {
int expected_ovf = bits::SignedMulOverflow32(*i, *j, &expected_val);
int expected_ovf =
base::bits::SignedMulOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call(*j));
if (!expected_ovf) {
CHECK_EQ(expected_val, actual_val);
@ -5491,7 +5502,7 @@ TEST(RunInt32MulWithOverflowImm) {
Node* ovf = m.Projection(1, add);
m.StoreToPointer(&actual_val, MachineRepresentation::kWord32, val);
m.Return(ovf);
int expected_ovf = bits::SignedMulOverflow32(*i, *j, &expected_val);
int expected_ovf = base::bits::SignedMulOverflow32(*i, *j, &expected_val);
CHECK_EQ(expected_ovf, m.Call());
if (!expected_ovf) {
CHECK_EQ(expected_val, actual_val);
@ -5516,7 +5527,8 @@ TEST(RunInt32MulWithOverflowInBranchP) {
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
int32_t expected;
if (bits::SignedMulOverflow32(*i, *j, &expected)) expected = constant;
if (base::bits::SignedMulOverflow32(*i, *j, &expected))
expected = constant;
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@ -5749,25 +5761,33 @@ TEST(RunFloat64Abs) {
TEST(RunFloat64Acos) {
BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
m.Return(m.Float64Acos(m.Parameter(0)));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::acos(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::acos(*i), m.Call(*i));
}
}
TEST(RunFloat64Acosh) {
BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
m.Return(m.Float64Acosh(m.Parameter(0)));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::acosh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::acosh(*i), m.Call(*i));
}
}
TEST(RunFloat64Asin) {
BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
m.Return(m.Float64Asin(m.Parameter(0)));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::asin(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::asin(*i), m.Call(*i));
}
}
TEST(RunFloat64Asinh) {
BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
m.Return(m.Float64Asinh(m.Parameter(0)));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::asinh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::asinh(*i), m.Call(*i));
}
}
TEST(RunFloat64Atan) {
@ -5777,7 +5797,9 @@ TEST(RunFloat64Atan) {
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
CHECK_DOUBLE_EQ(-0.0, m.Call(-0.0));
CHECK_DOUBLE_EQ(0.0, m.Call(0.0));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::atan(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::atan(*i), m.Call(*i));
}
}
TEST(RunFloat64Atanh) {
@ -5789,7 +5811,9 @@ TEST(RunFloat64Atanh) {
CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(-1.0));
CHECK_DOUBLE_EQ(-0.0, m.Call(-0.0));
CHECK_DOUBLE_EQ(0.0, m.Call(0.0));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::atanh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::atanh(*i), m.Call(*i));
}
}
TEST(RunFloat64Atan2) {
@ -5798,7 +5822,7 @@ TEST(RunFloat64Atan2) {
m.Return(m.Float64Atan2(m.Parameter(0), m.Parameter(1)));
FOR_FLOAT64_INPUTS(i) {
FOR_FLOAT64_INPUTS(j) {
CHECK_DOUBLE_EQ(ieee754::atan2(*i, *j), m.Call(*i, *j));
CHECK_DOUBLE_EQ(base::ieee754::atan2(*i, *j), m.Call(*i, *j));
}
}
}
@ -5808,7 +5832,7 @@ TEST(RunFloat64Cos) {
m.Return(m.Float64Cos(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::cos(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(base::ieee754::cos(*i), m.Call(*i)); }
}
TEST(RunFloat64Cosh) {
@ -5816,7 +5840,9 @@ TEST(RunFloat64Cosh) {
m.Return(m.Float64Cosh(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::cosh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::cosh(*i), m.Call(*i));
}
}
TEST(RunFloat64Exp) {
@ -5829,7 +5855,7 @@ TEST(RunFloat64Exp) {
CHECK_DOUBLE_EQ(1.0, m.Call(0.0));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::exp(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(base::ieee754::exp(*i), m.Call(*i)); }
}
TEST(RunFloat64Expm1) {
@ -5840,7 +5866,9 @@ TEST(RunFloat64Expm1) {
CHECK_EQ(-1.0, m.Call(-std::numeric_limits<double>::infinity()));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::expm1(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::expm1(*i), m.Call(*i));
}
}
TEST(RunFloat64Log) {
@ -5855,7 +5883,7 @@ TEST(RunFloat64Log) {
CHECK_DOUBLE_EQ(0.0, m.Call(1.0));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(base::ieee754::log(*i), m.Call(*i)); }
}
TEST(RunFloat64Log1p) {
@ -5869,7 +5897,9 @@ TEST(RunFloat64Log1p) {
CHECK_DOUBLE_EQ(-0.0, m.Call(-0.0));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log1p(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::log1p(*i), m.Call(*i));
}
}
TEST(RunFloat64Log2) {
@ -5884,7 +5914,9 @@ TEST(RunFloat64Log2) {
CHECK_DOUBLE_EQ(0.0, m.Call(1.0));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log2(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::log2(*i), m.Call(*i));
}
}
TEST(RunFloat64Log10) {
@ -5898,7 +5930,9 @@ TEST(RunFloat64Log10) {
CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(0.0));
CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(),
m.Call(std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log10(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::log10(*i), m.Call(*i));
}
}
TEST(RunFloat64Cbrt) {
@ -5910,7 +5944,9 @@ TEST(RunFloat64Cbrt) {
m.Call(std::numeric_limits<double>::infinity()));
CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(),
m.Call(-std::numeric_limits<double>::infinity()));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::cbrt(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::cbrt(*i), m.Call(*i));
}
}
TEST(RunFloat64Sin) {
@ -5918,7 +5954,7 @@ TEST(RunFloat64Sin) {
m.Return(m.Float64Sin(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::sin(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(base::ieee754::sin(*i), m.Call(*i)); }
}
TEST(RunFloat64Sinh) {
@ -5926,7 +5962,9 @@ TEST(RunFloat64Sinh) {
m.Return(m.Float64Sinh(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::sinh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::sinh(*i), m.Call(*i));
}
}
TEST(RunFloat64Tan) {
@ -5934,7 +5972,7 @@ TEST(RunFloat64Tan) {
m.Return(m.Float64Tan(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::tan(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(base::ieee754::tan(*i), m.Call(*i)); }
}
TEST(RunFloat64Tanh) {
@ -5942,7 +5980,9 @@ TEST(RunFloat64Tanh) {
m.Return(m.Float64Tanh(m.Parameter(0)));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::tanh(*i), m.Call(*i)); }
FOR_FLOAT64_INPUTS(i) {
CHECK_DOUBLE_EQ(base::ieee754::tanh(*i), m.Call(*i));
}
}
static double two_30 = 1 << 30; // 2^30 is a smi boundary.

View File

@ -15,8 +15,9 @@
#include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h"
using namespace v8::internal;
using namespace v8::internal::compiler;
namespace v8 {
namespace internal {
namespace compiler {
static void UpdateMemoryReferences(Handle<Code> code, Address old_base,
Address new_base, uint32_t old_size,
@ -212,3 +213,7 @@ TEST(Uint32LessThanFunctionTableRelocation) {
// Check that after limit is increased, index is within bounds.
CHECK_EQ(0xaced, m.Call());
}
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -35,8 +35,6 @@
#include "test/cctest/heap/heap-tester.h"
#include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
namespace heap {

View File

@ -48,9 +48,6 @@
#include "test/cctest/heap/heap-tester.h"
#include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
using v8::Just;
namespace v8 {
namespace internal {
namespace heap {

View File

@ -18,7 +18,8 @@
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
namespace {
@ -105,3 +106,6 @@ TEST(CommaFunctionSequence) {
DCHECK(is_compiled["b"]);
DCHECK(is_compiled["c"]);
}
} // namespace internal
} // namespace v8

View File

@ -12,7 +12,8 @@
#include "src/unicode-cache.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
namespace {
@ -129,3 +130,6 @@ TEST(ContextualKeywordTokens) {
CHECK_TOK(Token::IDENTIFIER, scanner->current_token());
CHECK_TOK(Token::UNINITIALIZED, scanner->current_contextual_token());
}
} // namespace internal
} // namespace v8

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_TEST_CCTEST_TEST_API_H_
#define V8_TEST_CCTEST_TEST_API_H_
#include "src/v8.h"
#include "src/api.h"
@ -38,3 +41,5 @@ static void CheckReturnValue(const T& t, i::Address callback) {
CHECK_EQ(callback, isolate->external_callback_scope()->callback());
}
}
#endif // V8_TEST_CCTEST_TEST_API_H_

View File

@ -39,7 +39,8 @@
#include "src/ostreams.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// Test the x64 assembler by compiling some simple functions into
// a buffer and executing them. These tests do not initialize the
@ -2538,3 +2539,6 @@ TEST(AssemblerX64vmovups) {
}
#undef __
} // namespace internal
} // namespace v8

View File

@ -35,7 +35,8 @@
#include "src/zone/accounting-allocator.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(List) {
v8::V8::Initialize();
@ -65,3 +66,6 @@ TEST(List) {
CHECK_EQ(0, list->length());
delete list;
}
} // namespace internal
} // namespace v8

View File

@ -38,8 +38,8 @@
#include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// Removes trailing '0' digits.
// Can return the empty string if all digits are 0.
@ -313,3 +313,6 @@ TEST(BignumDtoaGayPrecision) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
}
}
} // namespace internal
} // namespace v8

View File

@ -33,8 +33,8 @@
#include "src/bignum.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static const int kBufferSize = 1024;
@ -1540,3 +1540,6 @@ TEST(AssignPowerUInt16) {
"343362267A7E8833119D31D02E18DB5B0E8F6A64B0ED0D0062FFFF",
buffer));
}
} // namespace internal
} // namespace v8

View File

@ -32,7 +32,8 @@
#include "src/bit-vector.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(BitVector) {
v8::internal::AccountingAllocator allocator;
@ -143,3 +144,6 @@ TEST(BitVector) {
CHECK(!v.Contains(243));
}
}
} // namespace internal
} // namespace v8

View File

@ -14,7 +14,8 @@
#include "src/feedback-vector-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(CodeLayoutWithoutUnwindingInfo) {
CcTest::InitializeVM();
@ -91,3 +92,6 @@ TEST(CodeLayoutWithUnwindingInfo) {
Code::kHeaderSize + RoundUp(buffer_size, kInt64Size) + kInt64Size +
unwinding_info_size - kHeapObjectTag);
}
} // namespace internal
} // namespace v8

View File

@ -38,7 +38,8 @@
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static Handle<Object> GetGlobalProperty(const char* name) {
Isolate* isolate = CcTest::i_isolate();
@ -705,3 +706,6 @@ TEST(InvocationCount) {
CompileRun("foo(); foo()");
CHECK_EQ(4, foo->feedback_vector()->invocation_count());
}
} // namespace internal
} // namespace v8

View File

@ -9,7 +9,8 @@
#include "src/assembler.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
const ConstantPoolEntry::Type kPtrType = ConstantPoolEntry::INTPTR;
const ConstantPoolEntry::Type kDblType = ConstantPoolEntry::DOUBLE;
@ -245,3 +246,6 @@ TEST(ConstantPoolNoSharing) {
access = builder.AddEntry(pos, dblValue);
CHECK_EQ(access, kOvflAccess);
}
} // namespace internal
} // namespace v8

View File

@ -43,8 +43,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(Hex) {
UnicodeCache uc;
@ -502,3 +502,6 @@ TEST(PositiveNumberToUint32) {
number = factory->NewHeapNumber(std::nan(""));
CHECK_EQ(PositiveNumberToUint32(*number), 0u);
}
} // namespace internal
} // namespace v8

View File

@ -31,7 +31,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
class DateCacheMock: public DateCache {
public:
@ -216,3 +217,6 @@ TEST(DateCacheVersion) {
CHECK_EQ(1.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
}
#endif // V8_INTL_SUPPORT
} // namespace internal
} // namespace v8

View File

@ -33,7 +33,7 @@
#include "src/heap/heap.h"
#include "test/cctest/cctest.h"
using namespace v8;
namespace v8 {
namespace {
@ -1174,3 +1174,5 @@ TEST(Regress3941_Reads) {
context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION);
}
}
} // namespace v8

View File

@ -39,7 +39,8 @@
#include "src/objects-inl.h"
#include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
namespace {
@ -310,3 +311,6 @@ TEST(MaximumClonedShallowObjectProperties) {
}
} // namespace
} // namespace internal
} // namespace v8

View File

@ -38,8 +38,8 @@
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
#define __ assm.
@ -959,3 +959,6 @@ TEST(DisasmX64) {
}
#undef __
} // namespace internal
} // namespace v8

View File

@ -33,9 +33,8 @@
#include "src/diy-fp.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(Subtract) {
DiyFp diy_fp1 = DiyFp(3, 0);
@ -90,3 +89,6 @@ TEST(Multiply) {
CHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFe) == product.f());
CHECK_EQ(11 + 13 + 64, product.e());
}
} // namespace internal
} // namespace v8

View File

@ -34,9 +34,8 @@
#include "src/double.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(Uint64Conversions) {
// Start by checking the byte-order.
@ -229,3 +228,6 @@ TEST(NextDouble) {
CHECK_EQ(V8_INFINITY,
Double(V8_2PART_UINT64_C(0x7fefffff, ffffffff)).NextDouble());
}
} // namespace internal
} // namespace v8

View File

@ -38,9 +38,8 @@
#include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// Removes trailing '0' digits.
static void TrimRepresentation(Vector<char> representation) {
@ -329,3 +328,6 @@ TEST(DtoaGayPrecision) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
}
}
} // namespace internal
} // namespace v8

View File

@ -16,8 +16,8 @@
#include "src/ic/stub-cache.h"
#include "src/objects-inl.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
//
// Helper functions.
@ -478,3 +478,6 @@ TEST(JSArrayAddingElementsGeneralizingiFastDoubleElements) {
.Check();
CHECK_EQ(array->map(), *previous_map);
}
} // namespace internal
} // namespace v8

View File

@ -37,7 +37,8 @@
#include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static const int kBufferSize = 100;
@ -291,3 +292,6 @@ TEST(FastDtoaGayPrecision) {
// succeed.
CHECK_GT(succeeded_15*1.0/total_15, 0.9999);
}
} // namespace internal
} // namespace v8

View File

@ -14,7 +14,8 @@
#include "src/objects-inl.h"
#include "test/cctest/test-feedback-vector.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
namespace {
@ -668,3 +669,6 @@ TEST(StoreOwnIC) {
}
} // namespace
} // namespace internal
} // namespace v8

View File

@ -22,8 +22,8 @@
#include "src/property.h"
#include "src/transitions.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// TODO(ishell): fix this once TransitionToPrototype stops generalizing
// all field representations (similar to crbug/448711 where elements kind
@ -2739,3 +2739,6 @@ TEST(HoleyMutableHeapNumber) {
CHECK(obj->IsMutableHeapNumber());
CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits());
}
} // namespace internal
} // namespace v8

View File

@ -35,7 +35,8 @@
#include "test/cctest/cctest.h"
#include "test/cctest/gay-fixed.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static const int kBufferSize = 500;
@ -510,3 +511,6 @@ TEST(FastFixedDtoaGayFixed) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
}
}
} // namespace internal
} // namespace v8

View File

@ -31,7 +31,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// This test must be executed first!
TEST(Default) {
@ -259,3 +260,6 @@ TEST(FlagsRemoveIncomplete) {
CHECK(argv[1]);
CHECK_EQ(2, argc);
}
} // namespace internal
} // namespace v8

View File

@ -33,7 +33,8 @@
#include "src/objects.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(EternalHandles) {
CcTest::InitializeVM();
@ -183,3 +184,6 @@ TEST(PhatomHandlesWithoutCallbacks) {
CHECK_EQ(2u, isolate->NumberOfPhantomHandleResetsSinceLastCall());
CHECK_EQ(0u, isolate->NumberOfPhantomHandleResetsSinceLastCall());
}
} // namespace internal
} // namespace v8

View File

@ -32,7 +32,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// Use a testing allocator that clears memory before deletion.
class ZeroingAllocationPolicy {
@ -165,3 +166,6 @@ TEST(DeleteEmpty) {
List<int> list(0);
}
}
} // namespace internal
} // namespace v8

View File

@ -33,8 +33,8 @@
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
// Anonymous namespace.
namespace {
@ -176,3 +176,6 @@ TEST(LiveEditDiffer) {
CompareStrings("abbabababababaaabbabababababbabbbbbbbababa",
"bbbbabababbbabababbbabababababbabbababa");
}
} // namespace internal
} // namespace v8

View File

@ -41,19 +41,8 @@
#include "test/cctest/cctest.h"
#include "test/cctest/trace-extension.h"
using v8::Function;
using v8::Local;
using v8::Object;
using v8::Script;
using v8::String;
using v8::TickSample;
using v8::Value;
using v8::internal::byte;
using v8::internal::Address;
using v8::internal::Handle;
using v8::internal::Isolate;
using v8::internal::JSFunction;
namespace v8 {
namespace internal {
static bool IsAddressWithinFuncCode(JSFunction* function, void* addr) {
Address address = reinterpret_cast<Address>(addr);
@ -294,3 +283,6 @@ TEST(JsEntrySp) {
CompileRun("js_entry_sp_level2();");
CHECK(!i::TraceExtension::GetJsEntrySp());
}
} // namespace internal
} // namespace v8

View File

@ -11,8 +11,8 @@
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::base;
using namespace v8::internal;
namespace v8 {
namespace internal {
class DeleteRecorder {
public:
@ -76,3 +76,6 @@ TEST(DisposeCollect) {
CHECK(deleted1);
CHECK(deleted2);
}
} // namespace internal
} // namespace v8

View File

@ -37,8 +37,8 @@
#include "src/feedback-vector-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static void SetUpNewSpaceWithPoisonedMementoAtTop() {
Isolate* isolate = CcTest::i_isolate();
@ -104,3 +104,6 @@ TEST(BadMementoAfterTopForceScavenge) {
// Force GC to test the poisoned memento handling
CcTest::CollectGarbage(i::NEW_SPACE);
}
} // namespace internal
} // namespace v8

View File

@ -11,7 +11,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static void CheckObject(Isolate* isolate, Handle<Object> obj,
const char* string) {
@ -71,3 +72,6 @@ TEST(NoSideEffectsToString) {
CheckObject(isolate, factory->NewJSObject(isolate->object_function()),
"#<Object>");
}
} // namespace internal
} // namespace v8

View File

@ -7,7 +7,8 @@
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate());
@ -909,3 +910,6 @@ TEST(OrderedHashSetDuplicateHashCodeDeletion) {
CHECK(OrderedHashSet::HasKey(isolate, *set, *key1));
CHECK(!OrderedHashSet::HasKey(isolate, *set, *key2));
}
} // namespace internal
} // namespace v8

View File

@ -36,8 +36,8 @@
#include "src/base/platform/platform.h"
#include "test/cctest/cctest.h"
using namespace ::v8::internal;
namespace v8 {
namespace internal {
TEST(VirtualMemory) {
v8::base::VirtualMemory* vm =
@ -52,3 +52,6 @@ TEST(VirtualMemory) {
CHECK(vm->Uncommit(block_addr, block_size));
delete vm;
}
} // namespace internal
} // namespace v8

View File

@ -32,8 +32,8 @@
#include "src/base/utils/random-number-generator.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static const int64_t kRandomSeeds[] = {-1, 1, 42, 100, 1234567890, 987654321};
@ -174,3 +174,6 @@ TEST_RANDOM_BIT(30)
TEST_RANDOM_BIT(31)
#undef TEST_RANDOM_BIT
} // namespace internal
} // namespace v8

View File

@ -89,8 +89,8 @@
#endif // V8_INTERPRETED_REGEXP
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static bool CheckParse(const char* input) {
v8::HandleScope scope(CcTest::isolate());
@ -2032,3 +2032,6 @@ TEST(UncachedExternalString) {
CompileRun("var re = /y(.)/; re.test('ab');");
ExpectString("external.substring(1).match(re)[1]", "z");
}
} // namespace internal
} // namespace v8

View File

@ -29,8 +29,8 @@
#include "src/property-details.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
void TestPairPositive(Representation more_general,
Representation less_general) {
@ -126,3 +126,6 @@ TEST(RepresentationMoreGeneralThan) {
TestPairNegative(Representation::External(), Representation::External());
TestPairPositive(Representation::External(), Representation::None());
}
} // namespace internal
} // namespace v8

View File

@ -17,8 +17,9 @@
#include "test/cctest/compiler/c-signature.h"
#include "test/cctest/compiler/call-tester.h"
using namespace v8::internal;
using namespace v8::internal::compiler;
namespace v8 {
namespace internal {
namespace compiler {
#define __ assm.
@ -134,3 +135,7 @@ TEST(WasmRelocationX64WasmMemorySizeReference) {
#endif
}
#undef __
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -95,9 +95,8 @@ class MyRandomNumberGenerator {
uint32_t i;
};
using namespace v8::internal;
namespace v8 {
namespace internal {
static const int DEEP_DEPTH = 8 * 1024;
static const int SUPER_DEEP_DEPTH = 80 * 1024;
@ -1667,3 +1666,6 @@ TEST(ExternalStringIndexOf) {
->Int32Value(context.local())
.FromJust());
}
} // namespace internal
} // namespace v8

View File

@ -36,7 +36,8 @@
#include "src/strtod.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static Vector<const char> StringToVector(const char* str) {
return Vector<const char>(str, StrLength(str));
@ -478,3 +479,6 @@ TEST(RandomStrtod) {
}
}
}
} // namespace internal
} // namespace v8

View File

@ -44,8 +44,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(Create) {
CcTest::InitializeVM();
@ -82,3 +82,6 @@ TEST(Create) {
}
}
}
} // namespace internal
} // namespace v8

View File

@ -10,10 +10,6 @@
#include "src/list-inl.h"
#include "test/cctest/cctest.h"
using v8::IdleTask;
using v8::Task;
using v8::Isolate;
#include "src/tracing/trace-event.h"
#define GET_TRACE_OBJECTS_LIST platform.GetMockTraceObjects()

View File

@ -19,7 +19,8 @@
#include "test/cctest/cctest.h"
#include "test/cctest/test-transitions.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(TransitionArray_SimpleFieldTransitions) {
CcTest::InitializeVM();
@ -302,3 +303,6 @@ TEST(TransitionArray_SameFieldNamesDifferentAttributes) {
DCHECK(transitions.IsSortedNoDuplicates());
}
} // namespace internal
} // namespace v8

View File

@ -12,7 +12,8 @@
#include "src/objects-inl.h"
#include "src/objects.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
void TestArrayBufferViewContents(LocalContext& env, bool should_use_buffer) {
v8::Local<v8::Object> obj_a = v8::Local<v8::Object>::Cast(
@ -83,3 +84,6 @@ TEST(AllocateNotExternal) {
CHECK(!buffer->IsExternal());
CHECK_EQ(memory, buffer->GetContents().Data());
}
} // namespace internal
} // namespace v8

View File

@ -18,8 +18,9 @@
#include "test/cctest/cctest.h"
#include "test/cctest/types-fuzz.h"
using namespace v8::internal;
using namespace v8::internal::compiler;
namespace v8 {
namespace internal {
namespace compiler {
namespace {
@ -1131,3 +1132,7 @@ TEST(Intersect) { Tests().Intersect(); }
TEST(Distributivity) { Tests().Distributivity(); }
TEST(GetRange) { Tests().GetRange(); }
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -36,8 +36,8 @@
#include "src/conversions.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
TEST(Utils1) {
CHECK_EQ(-1000000, FastD2I(-1000000.0));
@ -287,3 +287,6 @@ TEST(CPlusPlus11Features) {
j += 11;
}
}
} // namespace internal
} // namespace v8

View File

@ -30,8 +30,6 @@
#include "src/version.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
@ -46,10 +44,6 @@ void SetVersion(int major, int minor, int build, int patch,
Version::soname_ = soname;
}
} // namespace internal
} // namespace v8
static void CheckVersion(int major, int minor, int build,
int patch, bool candidate,
const char* expected_version_string,
@ -103,3 +97,6 @@ TEST(VersionString) {
"2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
#endif
}
} // namespace internal
} // namespace v8

View File

@ -42,7 +42,8 @@
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate());
@ -261,3 +262,6 @@ TEST(Regress399527) {
// marking bits which makes the weak map garbage.
CcTest::CollectAllGarbage();
}
} // namespace internal
} // namespace v8

View File

@ -42,7 +42,8 @@
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate());
@ -242,3 +243,6 @@ TEST(WeakSet_Regress2060b) {
CcTest::CollectAllGarbage();
CcTest::CollectAllGarbage();
}
} // namespace internal
} // namespace v8