Fix structural class checks

Enabled for debug builds to prevent bit rotting. Changed
DexFileAndClassPair to work with std::queue.

Re-enabled structural check tests.

Change-Id: Ia981564650bf1c7e418d8a73efcc15733ddf7501
diff --git a/test/131-structural-change/expected.txt b/test/131-structural-change/expected.txt
index cc7713d..1d19278 100644
--- a/test/131-structural-change/expected.txt
+++ b/test/131-structural-change/expected.txt
@@ -1,2 +1,3 @@
+JNI_OnLoad called
 Should really reach here.
 Done.
diff --git a/test/131-structural-change/src/Main.java b/test/131-structural-change/src/Main.java
index 6cbbd12..c748899 100644
--- a/test/131-structural-change/src/Main.java
+++ b/test/131-structural-change/src/Main.java
@@ -35,7 +35,7 @@
             e.printStackTrace(System.out);
         }
 
-        boolean haveOatFile = hasOat();
+        boolean haveOatFile = hasOatFile();
         boolean gotError = false;
         try {
             Class<?> bClass = getClass().getClassLoader().loadClass("B");
@@ -45,10 +45,10 @@
             e.printStackTrace(System.out);
         }
         if (haveOatFile ^ gotError) {
-            System.out.println("Did not get expected error.");
+            System.out.println("Did not get expected error. " + haveOatFile + " " + gotError);
         }
         System.out.println("Done.");
     }
 
-    private native static boolean hasOat();
+    private native static boolean hasOatFile();
 }
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index ad64b68..6beead4 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -324,13 +324,15 @@
     $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),130-hprof,$(ALL_ADDRESS_SIZES))
 
 # 131 is an old test. The functionality has been implemented at an earlier stage and is checked
-# in tests 138.
-ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
+# in tests 138. Blacklisted for debug builds since these builds have duplicate classes checks which
+# punt to interpreter.
+ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),debug,$(PREBUILD_TYPES), \
     $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
     $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),131-structural-change,$(ALL_ADDRESS_SIZES))
 
-# 138-duplicate-classes-check. Turned off temporarily, b/21333911.
-ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
+# 138-duplicate-classes-check. Turned on for debug builds since debug builds have duplicate classes
+# checks enabled, b/2133391.
+ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \
     $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \
     $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),138-duplicate-classes-check,$(ALL_ADDRESS_SIZES))