/** Perform pre-test initialization. */ @Before public void setUp() { fixture = new EnumDeclaration( IntegerDeclaration.createDeclaration( 1, false, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, "", 8)); }
/** Run the EnumDeclaration(IntegerDeclaration) constructor test. */ @Test public void testEnumDeclaration() { IntegerDeclaration containerType = IntegerDeclaration.createDeclaration( 1, false, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, "", 8); EnumDeclaration result = new EnumDeclaration(containerType); assertNotNull(result); String left = "[declaration] enum["; assertEquals(left, result.toString().substring(0, left.length())); }
/** Test the hashcode */ @Test public void hashcodeTest() { EnumDeclaration b = new EnumDeclaration( IntegerDeclaration.createDeclaration( 1, false, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, "", 8)); assertEquals(b.hashCode(), fixture.hashCode()); fixture.add(0, 1, "hello"); fixture.add(2, 3, "kitty"); b.add(0, 1, "hello"); b.add(2, 3, "kitty"); assertEquals(fixture.hashCode(), b.hashCode()); }