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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java

Issue 29313003: Don't evaluate << because of possible overflow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
index 7ca4ad0c85e2321bc601119dc4414ab94816fa42..dba7a124af50c0f3d272ad1c22f17248d9a7e0d8 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/constant/ConstantEvaluatorTest.java
@@ -184,7 +184,10 @@ public class ConstantEvaluatorTest extends ResolverTestCase {
}
public void test_leftShift_int_int() throws Exception {
- assertValue(64L, "16 << 2");
+ EvaluationResult result = getExpressionValue("16 << 2");
+ assertTrue(result.isValid());
+ // we cannot always evaluate "shift left" because of possible overflow
+ assertEquals(0, result.getValue());
}
public void test_lessThan_int_int() throws Exception {

Powered by Google App Engine
This is Rietveld 408576698