@Test
	public void testStructureArrayFieldReference() throws Exception {

		Address addr = addr(EXT_POINTERS_OFFSET);
		clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));

		Command<Program> cmd = new CreateStructureCmd(addr, 24);
		cmd.applyTo(program);

		Data d = program.getListing().getDataAt(addr);
		clearFieldNames((Structure) d.getDataType());

		cmd = new CreateArrayCmd(addr, 4, d.getDataType(), d.getLength());
		cmd.applyTo(program);

		Symbol s = createLabel(addr, "ArrayA");
		s.setPrimary();

		ReferenceManager refMgr = program.getReferenceManager();
		for (int i = 0; i < (4 * 24); i += 4) {
			Address a = addr(EXT_POINTERS_OFFSET + i);
			ReferenceIterator iter = refMgr.getReferencesTo(a);
			while (iter.hasNext()) {
				Reference ref = iter.next();
				Instruction instr = program.getListing().getInstructionAt(ref.getFromAddress());
				assertNotNull(instr);
				int opIndex = ref.getOperandIndex();
				String opStr =
					CodeUnitFormat.DEFAULT.getOperandRepresentationString(instr, opIndex);
				if (i == 0) {
					assertEquals("dword ptr [ArrayA]", opStr);
				}
				else {
					int e = i / 24;
					int f = i % 24;
					assertEquals(
						"dword ptr [ArrayA[" + e + "].field" + f + "_0x" + Integer.toHexString(f) +
							"]",
						opStr);
				}
			}
		}
	}
Sets up the fixture, for example, open a network connection.
This method is called before a test is executed.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/data/DataReferencesTest.java