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

Commit 2c677b19 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HDMICEC: Add equals test for CodecSad"

parents e84ebfc0 981814f1
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -24,6 +24,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;
@@ -107,6 +109,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<>();