]> git.ipfire.org Git - thirdparty/strongswan.git/commit
android: Mock parseInetAddress() method to fix unit tests
authorTobias Brunner <tobias@strongswan.org>
Wed, 13 May 2020 14:02:08 +0000 (16:02 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Jun 2020 12:42:38 +0000 (14:42 +0200)
commit84924249aabe6abdd6fcdaa7d8b58b17a06c9653
treed935f7d01971928e665e7d248b0de7b153db10cb
parenta22a1493c34da864871129250d75788ec3861712
android: Mock parseInetAddress() method to fix unit tests

The native parseInetAddressBytes() method called by that method is not
available when running the tests.

Not very pretty and there are some warnings because PowerMock does
reflection in some illegal way but it fixes the unit tests and does
not require any new dependencies like Apache Commons or Guava just to
parse IP addresses without DNS lookup.

Fixes: 2ef473be1532 ("android: Use helper to parse IP addresses where appropriate")
Fixes #3443.
src/frontends/android/app/build.gradle
src/frontends/android/app/src/test/java/org/strongswan/android/test/IPRangeSetTest.java
src/frontends/android/app/src/test/java/org/strongswan/android/test/IPRangeTest.java