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

Commit c0719ec6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "HDMICEC: Add equals test for CodecSad" am: 2c677b19 am: f2ba048e...

Merge "HDMICEC: Add equals test for CodecSad" am: 2c677b19 am: f2ba048e am: 79d21ae3 am: 1f0062eb

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1489238

Change-Id: I781ff66c51bbbf4ec0b4aa0f5ea7325b30cd3463
parents 40e0f1de 1f0062eb
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import androidx.test.filters.SmallTest;
import com.android.server.hdmi.HdmiUtils.CodecSad;
import com.android.server.hdmi.HdmiUtils.DeviceConfig;

import com.google.common.testing.EqualsTester;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -115,6 +117,22 @@ public class HdmiUtilsTest {
                        HdmiUtils.TARGET_NOT_UNDER_LOCAL_DEVICE);
    }

    @Test
    public void testEqualsCodecSad() {
        byte[] sad = {0x0a, 0x1b, 0x2c};
        String sadString = "0a1b2c";
        new EqualsTester()
                .addEqualityGroup(
                        new HdmiUtils.CodecSad(Constants.AUDIO_CODEC_LPCM, sad),
                        new HdmiUtils.CodecSad(Constants.AUDIO_CODEC_LPCM, sadString))
                .addEqualityGroup(
                        new HdmiUtils.CodecSad(Constants.AUDIO_CODEC_LPCM, sadString + "01"))
                .addEqualityGroup(new HdmiUtils.CodecSad(Constants.AUDIO_CODEC_DD, sadString))
                .addEqualityGroup(
                        new HdmiUtils.CodecSad(Constants.AUDIO_CODEC_DD, sadString + "01"))
                .testEquals();
    }

    @Test
    public void parseSampleXML() {
        List<DeviceConfig> config = new ArrayList<>();