File tree Expand file tree Collapse file tree 2 files changed +39
-27
lines changed
FFmpegAndroid/src/androidTest/java/com/github/hiteshsondhi88/libffmpeg Expand file tree Collapse file tree 2 files changed +39
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package com .github .hiteshsondhi88 .libffmpeg ;
2+
3+ import android .content .res .AssetManager ;
4+ import android .text .TextUtils ;
5+
6+ import com .github .hiteshsondhi88 .libffmpeg .utils .AssertionHelper ;
7+
8+ import java .io .IOException ;
9+ import java .io .InputStream ;
10+
11+ import static org .assertj .core .api .Assertions .assertThat ;
12+
13+ public class CpuArchTest extends CommonInstrumentationTestCase {
14+
15+ public void testFFmpegAssetsWithSha1Sum () {
16+ testFFmpegAsset (CpuArch .ARMv7 , "armeabi-v7a/ffmpeg" );
17+ testFFmpegAsset (CpuArch .ARMv7_NEON , "armeabi-v7a-neon/ffmpeg" );
18+ testFFmpegAsset (CpuArch .x86 , "x86/ffmpeg" );
19+ }
20+
21+ private void testFFmpegAsset (CpuArch cpuArch , String assetsPath ) {
22+ AssetManager assetMgr = getInstrumentation ().getContext ().getResources ().getAssets ();
23+ InputStream is = null ;
24+ try {
25+ is = assetMgr .open (assetsPath );
26+ String assetSha1Sum = FileUtils .SHA1 (is );
27+ assertThat (!TextUtils .isEmpty (cpuArch .getSha1 ())
28+ && !TextUtils .isEmpty (assetSha1Sum )
29+ && cpuArch .getSha1 ().equals (assetSha1Sum )).isTrue ();
30+ } catch (IOException e ) {
31+ Log .e (e );
32+ AssertionHelper .assertError ("error validating ffmpeg asset " +assetsPath );
33+ } finally {
34+ Util .close (is );
35+ }
36+
37+ }
38+
39+ }
You can’t perform that action at this time.
0 commit comments