submodules: update belle-sip and linphone and fix liblinphone tester

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-28 10:42:58 +02:00
parent 4c315e566c
commit 6ae8d5fbec
5 changed files with 28 additions and 21 deletions

4
.gitignore vendored
View file

@ -38,3 +38,7 @@ tests/*$py.class
tests/build.xml tests/build.xml
tests/project.properties tests/project.properties
ant_password.properties ant_password.properties
liblinphone_tester/liblinphonetester_*
liblinphone_tester/tests.output
tests/linphonetester_*
tests/tests.output

View file

@ -23,9 +23,10 @@ public class LogsActivity extends Activity {
@Override @Override
public void run() { public void run() {
String path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files"; String res_path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String write_path = mLogsActivity.getCacheDir().getPath();
tester = new TesterLogger(mLogsActivity); tester = new TesterLogger(mLogsActivity);
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", path})); List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path}));
list.addAll(Arrays.asList(mArgs)); list.addAll(Arrays.asList(mArgs));
String[] array = list.toArray(new String[list.size()]); String[] array = list.toArray(new String[list.size()]);
tester.run(array); tester.run(array);
@ -37,7 +38,7 @@ public class LogsActivity extends Activity {
}); });
} }
} }
private static String join(String [] array, String separator) { private static String join(String [] array, String separator) {
String ret = ""; String ret = "";
for(int i = 0; i < array.length; ++i) { for(int i = 0; i < array.length; ++i) {
@ -48,7 +49,7 @@ public class LogsActivity extends Activity {
} }
return ret; return ret;
} }
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -75,7 +76,7 @@ public class LogsActivity extends Activity {
getMenuInflater().inflate(R.menu.activity_logs, menu); getMenuInflater().inflate(R.menu.activity_logs, menu);
return true; return true;
} }
public void addLog(int level, String message) { public void addLog(int level, String message) {
mLogs += message; mLogs += message;
((TextView)findViewById(R.id.textView1)).append(message); ((TextView)findViewById(R.id.textView1)).append(message);
@ -86,7 +87,7 @@ public class LogsActivity extends Activity {
finish(); finish();
} }
} }
public void done() { public void done() {
} }
} }

View file

@ -16,28 +16,28 @@ public class TestUnit extends AndroidTestCase {
private String mSuite; private String mSuite;
private String mTest; private String mTest;
static Boolean isAssetCopied=false; static Boolean isAssetCopied=false;
public TestUnit(String suite, String test) { public TestUnit(String suite, String test) {
mSuite = suite; mSuite = suite;
mTest = test; mTest = test;
setName(suite + "/" + test); setName(suite + "/" + test);
} }
public TestUnit(String name) { public TestUnit(String name) {
String[] tab = name.split("/"); String[] tab = name.split("/");
mSuite = tab[0]; mSuite = tab[0];
mTest = tab[1]; mTest = tab[1];
setName(name); setName(name);
} }
static public void copyAssetsFromPackage(Context ctx) throws IOException { static public void copyAssetsFromPackage(Context ctx) throws IOException {
copyAssetsFromPackage(ctx,"config_files"); copyAssetsFromPackage(ctx,"config_files");
} }
public static void copyAssetsFromPackage(Context ctx,String fromPath) throws IOException { public static void copyAssetsFromPackage(Context ctx,String fromPath) throws IOException {
new File(ctx.getFilesDir().getPath()+"/"+fromPath).mkdir(); new File(ctx.getFilesDir().getPath()+"/"+fromPath).mkdir();
for (String f :ctx.getAssets().list(fromPath)) { for (String f :ctx.getAssets().list(fromPath)) {
String current_name=fromPath+"/"+f; String current_name=fromPath+"/"+f;
InputStream lInputStream; InputStream lInputStream;
@ -50,8 +50,8 @@ public class TestUnit extends AndroidTestCase {
continue; continue;
} }
FileOutputStream lOutputStream = new FileOutputStream(new File(ctx.getFilesDir().getPath()+"/"+current_name));//ctx.openFileOutput (fromPath+"/"+f, 0); FileOutputStream lOutputStream = new FileOutputStream(new File(ctx.getFilesDir().getPath()+"/"+current_name));//ctx.openFileOutput (fromPath+"/"+f, 0);
int readByte; int readByte;
byte[] buff = new byte[8048]; byte[] buff = new byte[8048];
while (( readByte = lInputStream.read(buff)) != -1) { while (( readByte = lInputStream.read(buff)) != -1) {
@ -75,13 +75,15 @@ public class TestUnit extends AndroidTestCase {
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
super.tearDown(); super.tearDown();
} }
@Override @Override
protected void runTest() { protected void runTest() {
String path = getContext().getFilesDir().getPath()+"/config_files"; String res_path = getContext().getFilesDir().getPath()+"/config_files";
String write_path = getContext().getCacheDir().getPath();
Tester tester = new Tester(); Tester tester = new Tester();
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", path, "--suite", mSuite, "--test", mTest}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path, "--suite", mSuite, "--test", mTest}));
String[] array = list.toArray(new String[list.size()]); String[] array = list.toArray(new String[list.size()]);
Assert.assertTrue(tester.run(array) == 0); Assert.assertTrue(tester.run(array) == 0);
} }
} }

@ -1 +1 @@
Subproject commit 07233a793594081d5aafc0c6bb14d389dffbfac0 Subproject commit 6e76dabb7632e0f58e9c43b2cc86ada5f486c761

@ -1 +1 @@
Subproject commit 46547098cc1f24a394d6aa7c4e7823226ecab0fe Subproject commit 9244a017373d9ddec9170257fec324fb82cb0800