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

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

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

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

Change-Id: I34ab813644a4f40e36218b0574091bd6d19dd893
parents b5e1145b 2c677b19
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<>();