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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java

Issue 9160004: Provide better debugging if a null type is encountered. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated feedback to use fast null check Created 8 years, 11 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: compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java b/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
index 80eecba953a054014f17b5253096a8a823aca2b7..679f4c94efe0e1f60dac98fb52bee32d3728bffb 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
@@ -68,6 +68,7 @@ abstract class TypeTestCase extends TestCase {
final FunctionType stringAndIntToMap = ftype(function, stringIntMap,
null, null, itype(string), itype(intElement));
private int expectedTypeErrors = 0;
+ private int foundTypeErrors = 0;
abstract Types getTypes();
@@ -94,10 +95,11 @@ abstract class TypeTestCase extends TestCase {
protected void setExpectedTypeErrorCount(int count) {
checkExpectedTypeErrorCount();
expectedTypeErrors = count;
+ foundTypeErrors = 0;
}
protected void checkExpectedTypeErrorCount(String message) {
- assertEquals(message, 0, expectedTypeErrors);
+ assertEquals(message, expectedTypeErrors, foundTypeErrors);
}
protected void checkExpectedTypeErrorCount() {
@@ -174,8 +176,8 @@ abstract class TypeTestCase extends TestCase {
public void onError(DartCompilationError event) {
if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
getErrorCodes().add(event.getErrorCode());
- expectedTypeErrors--;
- if (expectedTypeErrors < 0) {
+ foundTypeErrors++;
+ if (expectedTypeErrors - foundTypeErrors < 0) {
throw new TestTypeError(event);
}
}

Powered by Google App Engine
This is Rietveld 408576698