1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.ink.geometry 18 19 import com.google.common.truth.Truth.assertThat 20 import org.junit.Test 21 import org.junit.runner.RunWith 22 import org.junit.runners.JUnit4 23 24 @RunWith(JUnit4::class) 25 class MeshFormatTest { 26 27 @Test isPackedEquivalent_withSameInstance_returnsTruenull28 fun isPackedEquivalent_withSameInstance_returnsTrue() { 29 val meshFormat = Mesh().format 30 assertThat(meshFormat.isPackedEquivalent(meshFormat)).isTrue() 31 } 32 33 @Test isPackedEquivalent_withEquivalent_returnsTruenull34 fun isPackedEquivalent_withEquivalent_returnsTrue() { 35 val meshFormat = Mesh().format 36 assertThat(meshFormat.isPackedEquivalent(Mesh().format)).isTrue() 37 } 38 39 @Test isUnpackedEquivalent_withSameInstance_returnsTruenull40 fun isUnpackedEquivalent_withSameInstance_returnsTrue() { 41 val meshFormat = Mesh().format 42 assertThat(meshFormat.isUnpackedEquivalent(meshFormat)).isTrue() 43 } 44 45 @Test isUnpackedEquivalent_withEquivalent_returnsTruenull46 fun isUnpackedEquivalent_withEquivalent_returnsTrue() { 47 val meshFormat = Mesh().format 48 assertThat(meshFormat.isUnpackedEquivalent(Mesh().format)).isTrue() 49 } 50 } 51