@Test
	public void testReplaceAtWithZeroLength() {
		Array zeroArray = new ArrayDataType(FloatDataType.dataType, 0, -1);
		struct.insertAtOffset(3, zeroArray, -1);
		assertEquals(8, struct.getLength());
		assertEquals(5, struct.getNumDefinedComponents());

		// replace dword with short
		struct.replaceAtOffset(3, ShortDataType.dataType, -1, "b", null);

		assertEquals(8, struct.getLength());
		assertEquals(5, struct.getNumDefinedComponents());

		DataTypeComponent[] comps = struct.getDefinedComponents();

		assertEquals(0, comps[0].getOffset());
		assertEquals(0, comps[0].getOrdinal());
		assertTrue(ByteDataType.dataType.isEquivalent(comps[0].getDataType()));

		assertEquals(1, comps[1].getOffset());
		assertEquals(1, comps[1].getOrdinal());
		assertTrue(WordDataType.dataType.isEquivalent(comps[1].getDataType()));

		assertEquals(3, comps[2].getOffset());
		assertEquals(2, comps[2].getOrdinal());
		assertTrue(zeroArray.isEquivalent(comps[2].getDataType()));

		assertEquals(3, comps[3].getOffset());
		assertEquals(3, comps[3].getOrdinal());
		assertTrue(ShortDataType.dataType.isEquivalent(comps[3].getDataType()));

		assertEquals(7, comps[4].getOffset());
		assertEquals(6, comps[4].getOrdinal());
		assertTrue(ByteDataType.dataType.isEquivalent(comps[4].getDataType()));

		Array zeroArray2 = new ArrayDataType(CharDataType.dataType, 0, -1);

		// replace float[0] with char[0]
		struct.replaceAtOffset(3, zeroArray2, -1, "a", null);

		comps = struct.getDefinedComponents();

		assertEquals(0, comps[0].getOffset());
		assertEquals(0, comps[0].getOrdinal());
		assertTrue(ByteDataType.dataType.isEquivalent(comps[0].getDataType()));

		assertEquals(1, comps[1].getOffset());
		assertEquals(1, comps[1].getOrdinal());
		assertTrue(WordDataType.dataType.isEquivalent(comps[1].getDataType()));

		assertEquals(3, comps[2].getOffset());
		assertEquals(2, comps[2].getOrdinal());
		assertTrue(zeroArray.isEquivalent(comps[2].getDataType()));

		assertEquals(3, comps[3].getOffset());
		assertEquals(3, comps[3].getOrdinal());
		assertTrue(zeroArray2.isEquivalent(comps[3].getDataType()));

		assertEquals(7, comps[4].getOffset());
		assertEquals(8, comps[4].getOrdinal());
		assertTrue(ByteDataType.dataType.isEquivalent(comps[4].getDataType()));
	}
/Test
pack(disabled)
Structure Test {
   0   byte   1   field1   "Comment1"
   2   word   2      "Comment2"
   4   dword   4   field3   ""
   8   byte   1   field4   "Comment4"
   9   char[0]   0   zarray1   ""
   12   long   4   field4   ""
   16   long[0]   0   zarray2   ""
}
Length: 16 Alignment: 1
Ghidra/Features/Base/src/test/java/ghidra/program/model/data/StructureDataTypeTest.java