ref: 1e4f367a1de656ffc33d8003b4465353eafb7800
parent: 32545aefde8d36df201a3230a6f95976236ae7c8
author: zhuling13 <zhulingwei2012@gmail.com>
date: Thu May 22 20:59:40 EDT 2014
clear up TAP space
--- a/Makefile
+++ b/Makefile
@@ -174,7 +174,7 @@
LIBRARIES +=$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(CODEC_UNITTEST_DEPS)
$(QUIET)rm -f $@
- $(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS)
+ $(QUIET_CXX)$(CXX) $(SHARED) $(LDFLAGS) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS)
binaries: codec_unittest$(EXEEXT)
BINARIES += codec_unittest$(EXEEXT)
--- a/test/api/simple_test.cpp
+++ b/test/api/simple_test.cpp
@@ -11,7 +11,7 @@
int main (int argc, char** argv) {
#endif
-#if defined(ANDROID_NDK)
+#if defined(ANDROID_NDK)
char xmlPath[1024] = "";
sprintf(xmlPath,"xml:%s",argv[1]);
::testing::GTEST_FLAG(output) = xmlPath;
--- a/test/build/android/jni/Android.mk
+++ b/test/build/android/jni/Android.mk
@@ -2,7 +2,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := libUT
+LOCAL_MODULE := libUT
LOCAL_SRC_FILES := ../../../../libut.so
include $(PREBUILT_SHARED_LIBRARY)
@@ -20,7 +20,7 @@
#
LOCAL_SRC_FILES := \
-codec_unittest.cpp
+codec_unittest.cpp
#
# Header Includes
#
@@ -35,6 +35,6 @@
endif
LOCAL_LDLIBS := -llog
-LOCAL_SHARED_LIBRARIES := libUT
+LOCAL_SHARED_LIBRARIES := libUT
include $(BUILD_SHARED_LIBRARY)
--- a/test/build/android/jni/codec_unittest.cpp
+++ b/test/build/android/jni/codec_unittest.cpp
@@ -7,17 +7,16 @@
#define LOG_TAG "codec_unittest"
#define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
-int CodecUtMain(int argc, char** argv);
+int CodecUtMain(int argc, char** argv);
extern "C"
-JNIEXPORT void JNICALL Java_com_cisco_codec_unittest_MainActivity_DoUnittest
+JNIEXPORT void JNICALL Java_com_cisco_codec_unittest_MainActivity_DoUnittest
(JNIEnv* env, jobject thiz,jstring jspath) {
/**************** Add the native codes/API *****************/
char* argv[2];
int argc = 2;
argv[0] = (char*) ("codec_unittest.exe");
-
argv[1] = (char*) ((*env).GetStringUTFChars (jspath,NULL));
- LOGI ("PATH:",+argv[1]);
+ LOGI ("PATH:",+argv[1]);
LOGI ("Start to run JNI module!+++");
CodecUtMain(argc,argv);
LOGI ("End to run JNI module!+++");
--- a/test/build/android/src/com/cisco/codec/unittest/MainActivity.java
+++ b/test/build/android/src/com/cisco/codec/unittest/MainActivity.java
@@ -11,7 +11,7 @@
import android.os.Process;
public class MainActivity extends Activity {
-
+
private TextView mStatusView;
@Override
@@ -18,11 +18,11 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
-
+
mStatusView = (TextView)findViewById(R.id.status_view);
-
+
runUnitTest();
-
+
}
@Override
@@ -30,13 +30,13 @@
{
Process.killProcess(Process.myPid());
}
-
-
-
+
+
+
public void runUnitTest()
{
Thread thread = new Thread() {
-
+
public void run()
{
Log.i("codec_unittest","codec unittest begin");
@@ -45,7 +45,7 @@
{
mStatusView.setText(text);
}
-
+
// String path = getIntent().getStringExtra("path");
// if (path.length() <=0)
// {
@@ -62,7 +62,7 @@
};
thread.start();
}
-
+
static{
try{
System.loadLibrary("stlport_shared");
@@ -69,13 +69,13 @@
//System.loadLibrary("openh264");
System.loadLibrary("ut");
System.loadLibrary("utDemo");
-
-
+
+
}
catch(Exception e){Log.v("codec_unittest","Load library failed");}
-
+
}
-
+
public native void DoUnittest(String path);
}