Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ec99f02 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Assert that RT_SCOPE_* and IFA_F_* are not zero."

parents 2bcf05e5 62388936
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import java.util.List;
import android.net.LinkAddress;
import android.os.Parcel;
import android.test.AndroidTestCase;
import static android.test.MoreAsserts.assertNotEqual;
import android.test.suitebuilder.annotation.SmallTest;

import static android.system.OsConstants.IFA_F_DEPRECATED;
@@ -50,6 +51,17 @@ public class LinkAddressTest extends AndroidTestCase {
    private static final InetAddress V4_ADDRESS = NetworkUtils.numericToInetAddress(V4);
    private static final InetAddress V6_ADDRESS = NetworkUtils.numericToInetAddress(V6);

    public void testConstants() {
        // RT_SCOPE_UNIVERSE = 0, but all the other constants should be nonzero.
        assertNotEqual(0, RT_SCOPE_HOST);
        assertNotEqual(0, RT_SCOPE_LINK);
        assertNotEqual(0, RT_SCOPE_SITE);

        assertNotEqual(0, IFA_F_DEPRECATED);
        assertNotEqual(0, IFA_F_PERMANENT);
        assertNotEqual(0, IFA_F_TENTATIVE);
    }

    public void testConstructors() throws SocketException {
        LinkAddress address;