Various fixes.

CHECK_xx arguments should be the "right" way round, not backwards like
ASSERT_xx and EXPECT_xx.

Use /mnt/sdcard/ rather than /sdcard/ to bypass FUSE and avoid getting
intermittent mkdir(2) "Device or resource busy" failures.

Better diagnostics when methods not found by test helpers.

Remove the whitelist from oatCompileMethod.

Leave evidence in the log of what we've compiled and where we put it.

Disable card marking by generated code until we have a cards to mark.

Distinguish between CanPutArrayElementFromCode and CanPutArrayElement.
Implement both.

Add a new test to see how much of the basic System and String/StringBuilder
facilities are working.

Change-Id: Ie24f2859e404ab912e6cc77d170ceb4df5ecdf19
diff --git a/src/object.h b/src/object.h
index 4edae14..fa09782 100644
--- a/src/object.h
+++ b/src/object.h
@@ -1092,7 +1092,7 @@
   }
 
   void SetLength(int32_t length) {
-    CHECK_LE(0, length);
+    CHECK_GE(length, 0);
     SetField32(OFFSET_OF_OBJECT_MEMBER(Array, length_), length, false);
   }
 
@@ -1421,7 +1421,12 @@
     return !IsPrimitive() && GetSuperClass() == NULL;
   }
 
-  static bool CanPutArrayElementFromCode(const Class* elementClass, const Class* arrayClass);
+  // Tests whether an element of type 'object_class' can be
+  // assigned into an array of type 'array_class'.
+  static bool CanPutArrayElement(const Class* object_class, const Class* array_class);
+  // Like CanPutArrayElement, but throws an exception and
+  // unwinds the stack instead of returning false.
+  static void CanPutArrayElementFromCode(const Class* object_class, const Class* array_class);
 
   // Given the context of a calling Method, use its DexCache to
   // resolve a type to a Class. If it cannot be resolved, throw an