summaryrefslogtreecommitdiff
path: root/main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt
blob: 040606cf295ff88e7c3f49790824707753314557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import de.blinkt.openvpn.VpnProfile
import de.blinkt.openvpn.fragments.Utils
import org.junit.Assert
import org.junit.Test

class TestUiUtils {
    @Test
    fun testCompatModeUtil() {
        Assert.assertEquals(2, Utils.mapCompatVer(20400))
        Assert.assertEquals(0, Utils.mapCompatVer(20707))
        Assert.assertEquals(3, Utils.mapCompatVer(11723))
    }

    @Test
    fun testWarnings() {
        val vp = VpnProfile("unittest")
        vp.mUseCustomConfig = true;
        vp.mCustomConfigOptions = "\ntls-cipher DEFAULT:@SECLEVEL=0\n"

        val warnings = mutableListOf<String>()
        Utils.addSoftWarnings(warnings, vp)
        Assert.assertTrue(warnings.size >= 1)

    }
}