am 7a037a2d: Merge "Adding details section to passed PTS tests." into klp-dev

* commit '7a037a2df6579945b53889801ef2bde5a718b7f5':
  Adding details section to passed PTS tests.
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 2c25d3d..755cb45 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -126,7 +126,8 @@
 # Native test executables that need to have associated test XMLs.
 cts_native_exes := \
 	NativeMediaTest_SL \
-	NativeMediaTest_XA
+	NativeMediaTest_XA \
+	bionic-unit-tests-cts \
 
 cts_ui_tests := \
 	CtsUiAutomatorTests
diff --git a/build/test_executable.mk b/build/test_executable.mk
index 8b445a3..74b3a95 100644
--- a/build/test_executable.mk
+++ b/build/test_executable.mk
@@ -27,7 +27,7 @@
 
 cts_executable_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
 
-$(cts_executable_xml): PRIVATE_PATH := $(LOCAL_PATH)
+$(cts_executable_xml): PRIVATE_PATH := $(cts_src_test_path)
 $(cts_executable_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE)
 $(cts_executable_xml): PRIVATE_EXECUTABLE := $(LOCAL_MODULE)
 $(cts_executable_xml): $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) $(CTS_EXPECTATIONS) $(CTS_NATIVE_TEST_SCANNER) $(CTS_XML_GENERATOR)
diff --git a/suite/audio_quality/lib/src/audio/AudioProtocol.cpp b/suite/audio_quality/lib/src/audio/AudioProtocol.cpp
index c3457f5..25c1422 100644
--- a/suite/audio_quality/lib/src/audio/AudioProtocol.cpp
+++ b/suite/audio_quality/lib/src/audio/AudioProtocol.cpp
@@ -18,8 +18,8 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
+#include <UniquePtr.h>
 #include <utils/StrongPointer.h>
-#include <utils/UniquePtr.h>
 
 #include "audio/Buffer.h"
 #include "Log.h"
diff --git a/tests/tests/bionic/Android.mk b/tests/tests/bionic/Android.mk
new file mode 100644
index 0000000..06b64ea
--- /dev/null
+++ b/tests/tests/bionic/Android.mk
@@ -0,0 +1,26 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+cts_src_test_path := bionic/tests
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := bionic-unit-tests-cts
+
+LOCAL_ADDITION_DEPENDENCIES := \
+	$(LOCAL_PATH)/Android.mk \
+
+LOCAL_SHARED_LIBRARIES += \
+	libstlport \
+	libdl \
+
+LOCAL_WHOLE_STATIC_LIBRARIES += \
+	libBionicTests \
+
+LOCAL_STATIC_LIBRARIES += \
+	libgtest \
+	libgtest_main \
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
+LOCAL_CTS_TEST_PACKAGE := android.bionic
+
+include $(BUILD_CTS_EXECUTABLE)
diff --git a/tests/tests/nativemedia/sl/Android.mk b/tests/tests/nativemedia/sl/Android.mk
index d999b57..90d8863 100644
--- a/tests/tests/nativemedia/sl/Android.mk
+++ b/tests/tests/nativemedia/sl/Android.mk
@@ -3,6 +3,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
+cts_src_test_path := $(LOCAL_PATH)
+
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_C_INCLUDES:= \
diff --git a/tests/tests/nativemedia/xa/Android.mk b/tests/tests/nativemedia/xa/Android.mk
index dad8acd..9ff2110 100644
--- a/tests/tests/nativemedia/xa/Android.mk
+++ b/tests/tests/nativemedia/xa/Android.mk
@@ -3,6 +3,8 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
+cts_src_test_path := $(LOCAL_PATH)
+
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_C_INCLUDES:= \
diff --git a/tests/tests/security/src/android/security/cts/VoldExploitTest.java b/tests/tests/security/src/android/security/cts/VoldExploitTest.java
index 74d0f68..486d5f0 100644
--- a/tests/tests/security/src/android/security/cts/VoldExploitTest.java
+++ b/tests/tests/security/src/android/security/cts/VoldExploitTest.java
@@ -222,7 +222,7 @@
         Set<Integer> retval = new HashSet<Integer>();
         for (List<String> i : netlink) {
             // The PID is in column 3
-            int pid = Integer.decode(i.get(2));
+            int pid = Long.decode(i.get(2)).intValue();
             if (new File("/proc/" + pid + "/cmdline").exists()) {
                 retval.add(pid);
             }
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index cfeb1b0..1646dde 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -1159,8 +1159,11 @@
     }
 
     public void testRequestFocusNodeHref() throws Throwable {
-        final String links = "<DL><p><DT><A HREF=\"" + TestHtmlConstants.HTML_URL1
-                + "\">HTML_URL1</A><DT><A HREF=\"" + TestHtmlConstants.HTML_URL2
+        startWebServer(false);
+        String url1 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL1);
+        String url2 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL2);
+        final String links = "<DL><p><DT><A HREF=\"" + url1
+                + "\">HTML_URL1</A><DT><A HREF=\"" + url2
                 + "\">HTML_URL2</A></DL><p>";
         mOnUiThread.loadDataAndWaitForCompletion("<html><body>" + links + "</body></html>", "text/html", null);
         getInstrumentation().waitForIdleSync();
@@ -1190,7 +1193,7 @@
                 return done;
             }
         }.run();
-        assertEquals(TestHtmlConstants.HTML_URL1, handler.getResultUrl());
+        assertEquals(url1, handler.getResultUrl());
 
         // focus on second link
         handler.reset();
@@ -1202,9 +1205,10 @@
             @Override
             protected boolean check() {
                 boolean done = false;
+                final String url2 = mWebServer.getAssetUrl(TestHtmlConstants.HTML_URL2);
                 if (handler.hasCalledHandleMessage()) {
                     if (handler.mResultUrl != null &&
-                            handler.mResultUrl.equals(TestHtmlConstants.HTML_URL2)) {
+                            handler.mResultUrl.equals(url2)) {
                         done = true;
                     } else {
                         handler.reset();
@@ -1216,7 +1220,7 @@
                 return done;
             }
         }.run();
-        assertEquals(TestHtmlConstants.HTML_URL2, handler.getResultUrl());
+        assertEquals(url2, handler.getResultUrl());
 
         mOnUiThread.requestFocusNodeHref(null);
     }
diff --git a/tools/cts-native-scanner/src/com/android/cts/nativescanner/TestScanner.java b/tools/cts-native-scanner/src/com/android/cts/nativescanner/TestScanner.java
index 0a1b207..370b509 100644
--- a/tools/cts-native-scanner/src/com/android/cts/nativescanner/TestScanner.java
+++ b/tools/cts-native-scanner/src/com/android/cts/nativescanner/TestScanner.java
@@ -78,11 +78,13 @@
         }
     }
 
-    // We want to find lines like TEST_F(SLObjectCreationTest, testAudioPlayerFromFdCreation) { ...
+    // We want to find lines like TEST_F(SLObjectCreationTest, testAudioPlayerFromFdCreation)
+    // or TEST(stdio, printf) { ...
     // and extract the "SLObjectCreationTest" as group #1,
     // "testAudioPlayerFromFdCreation" as group #2
+    // TODO: It would be better to concatenate the two parts.
     private static final Pattern METHOD_REGEX =
-            Pattern.compile("\\s*TEST_F\\((\\w+),\\s*(\\w+)\\).*");
+            Pattern.compile("\\s*TEST(?:_F)?\\((\\w+),\\s*(\\w+)\\).*");
 
     public void scanFile(Scanner scanner, List<String> testNames) {
         try {