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

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

Issue 248033: Return the original value when assigning to a pixel array (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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/ia32/ic-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 2984)
+++ test/cctest/test-api.cc (working copy)
@@ -7729,8 +7729,44 @@
CHECK_EQ(1503, result->Int32Value());
result = CompileRun("pixels[1]");
CHECK_EQ(1, result->Int32Value());
+
result = CompileRun("var sum = 0;"
"for (var i = 0; i < 8; i++) {"
+ " sum += pixels[i] = pixels[i] = -i;"
+ "}"
+ "sum;");
+ CHECK_EQ(-28, result->Int32Value());
+
+ result = CompileRun("var sum = 0;"
+ "for (var i = 0; i < 8; i++) {"
+ " sum += pixels[i] = pixels[i] = 0;"
+ "}"
+ "sum;");
+ CHECK_EQ(0, result->Int32Value());
+
+ result = CompileRun("var sum = 0;"
+ "for (var i = 0; i < 8; i++) {"
+ " sum += pixels[i] = pixels[i] = 255;"
+ "}"
+ "sum;");
+ CHECK_EQ(8 * 255, result->Int32Value());
+
+ result = CompileRun("var sum = 0;"
+ "for (var i = 0; i < 8; i++) {"
+ " sum += pixels[i] = pixels[i] = 256 + i;"
+ "}"
+ "sum;");
+ CHECK_EQ(2076, result->Int32Value());
+
+ result = CompileRun("var sum = 0;"
+ "for (var i = 0; i < 8; i++) {"
+ " sum += pixels[i] = pixels[i] = i;"
+ "}"
+ "sum;");
+ CHECK_EQ(28, result->Int32Value());
+
+ result = CompileRun("var sum = 0;"
+ "for (var i = 0; i < 8; i++) {"
" sum += pixels[i];"
"}"
"sum;");
@@ -7839,6 +7875,9 @@
CHECK_EQ(77, v8::Object::Cast(*result)->Get(v8_str("0"))->Int32Value());
CHECK_EQ(23, v8::Object::Cast(*result)->Get(v8_str("1"))->Int32Value());
+ result = CompileRun("pixels[1] = 23;");
+ CHECK_EQ(23, result->Int32Value());
+
free(pixel_data);
}
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698