@Test
	public void testCompoundStructureFieldReference() 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());

		for (int i = 1; i < 4; i++) {
			Address a = addr(EXT_POINTERS_OFFSET + (i * 24));
			cmd = new ClearCmd(new AddressSet(a, a.add(23)));
			cmd.applyTo(program);
			cmd = new CreateDataCmd(a, d.getDataType());
			cmd.applyTo(program);
		}

		cmd = new CreateStructureCmd(addr, 4 * 24);
		cmd.applyTo(program);

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

		Symbol s = createLabel(addr, "StructA");
		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 [StructA]", opStr);
				}
				else {
					int f1Ordinal = i / 24;
					int f1Offset = f1Ordinal * 24;
					int f2 = i % 24;
					assertEquals("dword ptr [StructA.field" + f1Ordinal + "_0x" +
						Integer.toHexString(f1Offset) +
						".field" + f2 + "_0x" + Integer.toHexString(f2) + "]", 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