blob: d0f0fe315bcfd373237bd98ea7aa254a95969767 [file] [log] [blame]
Jorim Jaggi817ebdd2018-03-26 15:46:01 +02001/*
2 * Copyright (C) 2018 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
17package com.android.server.wm.utils;
18
19import static junit.framework.Assert.assertEquals;
20
21import android.graphics.Rect;
22import android.platform.test.annotations.Presubmit;
23import android.support.test.filters.SmallTest;
24import android.support.test.runner.AndroidJUnit4;
Tadashi G. Takaoka18c909c2018-10-11 07:51:35 +000025import android.util.Pair;
Jorim Jaggi817ebdd2018-03-26 15:46:01 +020026
27import org.junit.Test;
28import org.junit.runner.RunWith;
29
Jorim Jaggi817ebdd2018-03-26 15:46:01 +020030@RunWith(AndroidJUnit4.class)
31@SmallTest
32@Presubmit
33public class InsetUtilsTest {
34
35 @Test
36 public void testAdd() throws Exception {
37 final Rect rect1 = new Rect(10, 20, 30, 40);
38 final Rect rect2 = new Rect(50, 60, 70, 80);
39 InsetUtils.addInsets(rect1, rect2);
40 assertEquals(new Rect(60, 80, 100, 120), rect1);
41 }
42}
43