aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/test/java/org/osjava/jardiff/ToolsTest.java
blob: 8066264a480b260f75f493bac9b2138c6d0469c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package org.osjava.jardiff;

import org.junit.Test;
import org.objectweb.asm.Opcodes;
import static org.junit.Assert.*;

public class ToolsTest {

    @Test
    public void isAccessChange() {
        assertTrue(Tools.isAccessChange(0, Opcodes.ACC_FINAL));
        assertTrue(Tools.isAccessChange(0, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL));
        assertTrue(Tools.isAccessChange(Opcodes.ACC_FINAL + Opcodes.ACC_PUBLIC, 0));
        assertTrue(Tools.isAccessChange(Opcodes.ACC_PUBLIC, Opcodes.ACC_PROTECTED));
        assertFalse(Tools.isAccessChange(Opcodes.ACC_FINAL, 0));
        assertFalse(Tools.isAccessChange(Opcodes.ACC_FINAL + Opcodes.ACC_PUBLIC, Opcodes.ACC_PUBLIC));
    }

}