Update the Wilhelm unit tests

Some of the unit tests had experienced bit rot, so fixed the tests to
run again.  Except "xa" is not completely fixed yet.

Change-Id: I97ebc87cd859bd2b9893f0b315d94b1a09c85c09
diff --git a/src/ut/OpenSLESUT.c b/src/ut/OpenSLESUT.c
index f7f6353..f6e736a 100644
--- a/src/ut/OpenSLESUT.c
+++ b/src/ut/OpenSLESUT.c
@@ -17,8 +17,10 @@
 /** \file OpenSLESUT.c OpenSL ES Utility Toolkit */
 
 #include <SLES/OpenSLES.h>
+#include <OMXAL/OpenMAXAL.h>
 #ifdef ANDROID
 #include <SLES/OpenSLES_Android.h>
+#include <OMXAL/OpenMAXAL_Android.h>
 #endif
 #include "OpenSLESUT.h"
 #include <stdio.h>
@@ -36,7 +38,8 @@
 // ## is token concatenation e.g. a##b becomes ab
 // # is stringize operator to convert a symbol to a string constant e.g. #a becomes "a"
 
-#define _(x) { &SL_IID_##x, #x }
+#define _(x) { &SL_IID_##x, "SL_IID_" #x }
+#define _X(x) { (const SLInterfaceID *) &XA_IID_##x, "XA_IID_" #x }
 
 /** \brief Array of mappings from interface IDs to display names */
 
@@ -88,12 +91,15 @@
 #if 0 // ifdef USE_OUTPUTMIXEXT
     _(OUTPUTMIXEXT),
 #endif
+    _X(ENGINE),
+    _X(VIDEODECODERCAPABILITIES),
 #ifdef ANDROID
     _(ANDROIDEFFECT),
     _(ANDROIDEFFECTCAPABILITIES),
     _(ANDROIDEFFECTSEND),
     _(ANDROIDCONFIGURATION),
     _(ANDROIDSIMPLEBUFFERQUEUE),
+    _(ANDROIDBUFFERQUEUESOURCE),
     _(ANDROIDACOUSTICECHOCANCELLATION),
     _(ANDROIDAUTOMATICGAINCONTROL),
     _(ANDROIDNOISESUPPRESSION)
diff --git a/tests/sandbox/Android.mk b/tests/sandbox/Android.mk
index 4297e91..bd87c0f 100644
--- a/tests/sandbox/Android.mk
+++ b/tests/sandbox/Android.mk
@@ -71,7 +71,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -103,7 +104,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -224,7 +226,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -255,7 +258,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -286,7 +290,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -317,7 +322,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -351,7 +357,8 @@
 	libaudioutils \
 	libnbaio \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -383,7 +390,8 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	liblog \
-	libOpenSLES
+	libOpenSLES \
+	libOpenMAXAL
 
 LOCAL_STATIC_LIBRARIES := \
     libOpenSLESUT \
@@ -493,6 +501,6 @@
 
 LOCAL_CFLAGS += -UNDEBUG -Wall -Wextra -Werror
 
-LOCAL_MODULE:= xaplay
+LOCAL_MODULE:= slesTest_xaplay
 
 include $(BUILD_EXECUTABLE)
diff --git a/tests/sandbox/engine.c b/tests/sandbox/engine.c
index 2d4acdf..9b17b35 100644
--- a/tests/sandbox/engine.c
+++ b/tests/sandbox/engine.c
@@ -140,7 +140,8 @@
         void *interface = NULL;
         result = (*engineObject)->GetInterface(engineObject, engine_ids[index], &interface);
         assert(SL_RESULT_SUCCESS == result);
-        printf("interface[%u] %p\n", index, interface);
+        printf("interface[%u] %p = ", index, interface);
+        slesutPrintIID(engine_ids[index]);
         // Use a copy of the interface ID to make sure lookup is not purely relying on address
         void *interface_again = NULL;
         struct SLInterfaceID_ copy = *engine_ids[index];
@@ -148,6 +149,8 @@
         assert(SL_RESULT_SUCCESS == result);
         // Calling GetInterface multiple times should return the same interface
         assert(interface_again == interface);
+        printf("copy = ");
+        slesutPrintIID(&copy);
     }
 
     SLObjectItf engineObject2;
diff --git a/tests/sandbox/object.c b/tests/sandbox/object.c
index 95caa38..993134f 100644
--- a/tests/sandbox/object.c
+++ b/tests/sandbox/object.c
@@ -158,7 +158,7 @@
 #ifdef ANDROID
     // whereas the implementation uses PLATFORM_SDK_VERSION, use a hard-coded value here
     // so that we're actually testing for a particular expected value
-    supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_19";
+    supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_25";
 #else
     supportedExt = (SLchar *) "WILHELM_DESKTOP";
 #endif
diff --git a/tests/sandbox/srcsink.c b/tests/sandbox/srcsink.c
index 35980f5..f78e651 100644
--- a/tests/sandbox/srcsink.c
+++ b/tests/sandbox/srcsink.c
@@ -114,7 +114,7 @@
     format_pcm.numChannels = 3;
     result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audioSrc,
             &audioSnk, 1, ids, req);
-    assert(SL_RESULT_CONTENT_UNSUPPORTED == result);
+    assert(SL_RESULT_PARAMETER_INVALID == result);
     assert(NULL == playerObject);
     format_pcm.numChannels = 2;
 
@@ -140,7 +140,7 @@
     format_pcm.bitsPerSample = 24;
     result = (*engineEngine)->CreateAudioPlayer(engineEngine, &playerObject, &audioSrc,
             &audioSnk, 1, ids, req);
-    assert(SL_RESULT_CONTENT_UNSUPPORTED == result);
+    assert(SL_RESULT_PARAMETER_INVALID == result);
     assert(NULL == playerObject);
     format_pcm.bitsPerSample = 16;
 
diff --git a/tests/sandbox/xa.c b/tests/sandbox/xa.c
index 1549ac4..2d8f2a5 100644
--- a/tests/sandbox/xa.c
+++ b/tests/sandbox/xa.c
@@ -73,6 +73,7 @@
     XADataLocator_AndroidBufferQueue locABQ;
     memset(&locABQ, 0, sizeof(locABQ));
     locABQ.locatorType = XA_DATALOCATOR_ANDROIDBUFFERQUEUE;
+    locABQ.numBuffers = 1;
 #else
     XADataLocator_URI locUri;
     locUri.locatorType = XA_DATALOCATOR_URI;
@@ -97,7 +98,7 @@
     audioSnk.pFormat = NULL;
     XADataLocator_NativeDisplay locND;
     locND.locatorType = XA_DATALOCATOR_NATIVEDISPLAY;
-    locND.hWindow = NULL;
+    locND.hWindow = NULL; // FIXME wrong
     locND.hDisplay = NULL;
     XADataSink imageVideoSink;
     imageVideoSink.pLocator = &locND;