Add tests for jni and detect native crash

This commit is contained in:
Margaux Clerc 2015-02-19 16:04:46 +01:00
parent 0c6b672fd7
commit 0e0e7d29be
2 changed files with 10 additions and 1 deletions

View file

@ -50,7 +50,10 @@
</condition>
</fail>
<condition property="has.crashed" >
<resourcecontains resource="${output.file}" substring="Process crashed" />
<or>
<resourcecontains resource="${output.file}" substring="Process crashed" />
<resourcecontains resource="${output.file}" substring="Native crash" />
</or>
</condition>
<antcall target="check-for-crash"/>
<delete file="${archive.name}"/>

View file

@ -3,6 +3,7 @@ package org.linphone.tester;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.core.PayloadType;
import android.test.AndroidTestCase;
import junit.framework.Assert;
@ -41,12 +42,17 @@ public class WrapperTester extends AndroidTestCase {
mCore.setVideoMulticastTtl(4);
Assert.assertEquals(4, mCore.getVideoMulticastTtl());
//Test setPrimaryContact
String address = "Linphone Android <sip:linphone.android@unknown-host>";
mCore.setPrimaryContact(address);
Assert.assertEquals(LinphoneCoreFactory.instance().createLinphoneAddress(address).getDisplayName(),
LinphoneCoreFactory.instance().createLinphoneAddress(mCore.getPrimaryContact()).getDisplayName());
Assert.assertEquals(LinphoneCoreFactory.instance().createLinphoneAddress(address).getUserName(),
LinphoneCoreFactory.instance().createLinphoneAddress(mCore.getPrimaryContact()).getUserName());
//Test setPayloadTypeNumber
mCore.setPayloadTypeNumber(mCore.findPayloadType("PCMU"),12);
Assert.assertEquals(mCore.getPayloadTypeNumber(mCore.findPayloadType("PCMU")),12);
}