Merge changes I31ddbed9,I702a2449 am: a730b44c86
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1489240 Change-Id: I490ac9074ecbf513b111108a8835e700d03af1fb
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.android.server.hdmi;
|
||||||
|
|
||||||
|
import androidx.test.filters.SmallTest;
|
||||||
|
|
||||||
|
import com.google.common.testing.EqualsTester;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.runners.JUnit4;
|
||||||
|
|
||||||
|
/** Tests for {@link HdmiCecMessage} class. */
|
||||||
|
@SmallTest
|
||||||
|
@RunWith(JUnit4.class)
|
||||||
|
public class HdmiCecMessageTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEqualsHdmiCecMessage() {
|
||||||
|
int source = 0;
|
||||||
|
int destination = 1;
|
||||||
|
int opcode = 0x7f;
|
||||||
|
byte[] params1 = {0x00, 0x1a, 0x2b, 0x3c};
|
||||||
|
byte[] params2 = {0x00, 0x1a, 0x2b, 0x3c, 0x4d};
|
||||||
|
|
||||||
|
new EqualsTester()
|
||||||
|
.addEqualityGroup(
|
||||||
|
new HdmiCecMessage(source, destination, opcode, params1),
|
||||||
|
new HdmiCecMessage(source, destination, opcode, params1))
|
||||||
|
.addEqualityGroup(new HdmiCecMessage(source, destination, opcode, params2))
|
||||||
|
.addEqualityGroup(new HdmiCecMessage(source + 1, destination, opcode, params1))
|
||||||
|
.addEqualityGroup(new HdmiCecMessage(source, destination + 1, opcode, params1))
|
||||||
|
.addEqualityGroup(new HdmiCecMessage(source, destination, opcode + 1, params1))
|
||||||
|
.testEquals();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user