Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: test/cctest/test-api.cc

Issue 6879009: Support Float64Arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 28a9be159937b9f1399efa6f7de5e9734751ba55..19492a53278f5fdb714633a941775f7a94945ab5 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -11380,6 +11380,9 @@ static int ExternalArrayElementSize(v8::ExternalArrayType array_type) {
case v8::kExternalFloatArray:
return 4;
break;
+ case v8::kExternalDoubleArray:
+ return 8;
+ break;
default:
UNREACHABLE();
return -1;
@@ -11569,7 +11572,8 @@ static void ExternalArrayTestHelper(v8::ExternalArrayType array_type,
CHECK_EQ(
2, static_cast<int>(jsobj->GetElement(6)->ToObjectChecked()->Number()));
- if (array_type != v8::kExternalFloatArray) {
+ if (array_type != v8::kExternalFloatArray &&
+ array_type != v8::kExternalDoubleArray) {
// Though the specification doesn't state it, be explicit about
// converting NaNs and +/-Infinity to zero.
result = CompileRun("for (var i = 0; i < 8; i++) {"
@@ -11966,6 +11970,14 @@ THREADED_TEST(ExternalFloatArray) {
}
+THREADED_TEST(ExternalDoubleArray) {
+ ExternalArrayTestHelper<i::ExternalDoubleArray, double>(
+ v8::kExternalDoubleArray,
+ -500,
+ 500);
+}
+
+
THREADED_TEST(ExternalArrays) {
TestExternalByteArray();
TestExternalUnsignedByteArray();
@@ -12003,6 +12015,7 @@ THREADED_TEST(ExternalArrayInfo) {
ExternalArrayInfoTestHelper(v8::kExternalIntArray);
ExternalArrayInfoTestHelper(v8::kExternalUnsignedIntArray);
ExternalArrayInfoTestHelper(v8::kExternalFloatArray);
+ ExternalArrayInfoTestHelper(v8::kExternalDoubleArray);
ExternalArrayInfoTestHelper(v8::kExternalPixelArray);
}
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698