Also print to error stream.

So we can test between all kinds of configuration (for example
host no-dex2oat removes all error logs).

Change-Id: I5936fdd963e3805c49258ee6ed50d8def23d1aca
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index e89c74d..0ddd4a2 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -16,6 +16,8 @@
 
 #include "java_lang_Class.h"
 
+#include <iostream>
+
 #include "art_field-inl.h"
 #include "class_linker.h"
 #include "common_throws.h"
@@ -303,7 +305,10 @@
       // We log the error for this specific case, as the user might just swallow the exception.
       // This helps diagnose crashes when applications rely on the String#value field being
       // there.
-      LOG(ERROR) << "The String#value field is not present on Android versions >= 6.0";
+      // Also print on the error stream to test it through run-test.
+      std::string message("The String#value field is not present on Android versions >= 6.0");
+      LOG(ERROR) << message;
+      std::cerr << message << std::endl;
     }
     // We may have a pending exception if we failed to resolve.
     if (!soa.Self()->IsExceptionPending()) {
diff --git a/test/143-string-value/check b/test/143-string-value/check
index cdf7b78..92f6e90 100755
--- a/test/143-string-value/check
+++ b/test/143-string-value/check
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Strip run-specific numbers (pid and line number)
-sed -e 's/^art E[ ]\+[0-9]\+[ ]\+[0-9]\+ art\/runtime\/native\/java_lang_Class.cc:[0-9]\+\] //' "$2" > "$2.tmp"
+# Strip error log messages.
+sed -e '/^art E.*\] /d' "$2" > "$2.tmp"
 
 diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index ee6b7aa..00db5a0 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -267,16 +267,6 @@
 
 TEST_ART_BROKEN_PREBUILD_RUN_TESTS :=
 
-# 143-string-value tests for a LOG(E) tag, which is only supported on host.
-TEST_ART_BROKEN_TARGET_RUN_TESTS := \
-  143-string-value \
-
-ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \
-    $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
-    $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TARGET_RUN_TESTS), $(ALL_ADDRESS_SIZES))
-
-TEST_ART_BROKEN_TARGET_RUN_TESTS :=
-
 # 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save.
 TEST_ART_BROKEN_NO_PREBUILD_TESTS := \
   117-nopatchoat \