private void setupStructureFieldNameVsPack() throws Exception {

		mtf.initialize("notepad", new OriginalProgramModifierListener() {

			@Override
			public void modifyOriginal(ProgramDB program) throws Exception {
				DataTypeManager dtm = program.getDataTypeManager();

				Structure s =
					(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2/Category3"),
						"IntStruct");
				assertEquals(15, s.getLength());
				assertEquals(1, s.getAlignment());
				s.setToDefaultPacking();

				// Offsets change to 0,2,4,8.
				assertEquals(0, s.getComponent(0).getOffset());
				assertEquals(2, s.getComponent(1).getOffset());
				assertEquals(4, s.getComponent(2).getOffset());
				assertEquals(8, s.getComponent(3).getOffset());
				assertEquals(16, s.getLength());
				assertEquals(4, s.getAlignment());
			}

			@Override
			public void modifyLatest(ProgramDB program) throws Exception {
				DataTypeManager dtm = program.getDataTypeManager();

				Structure s =
					(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2/Category3"),
						"IntStruct");
				assertEquals(16, s.getLength());
				assertEquals(4, s.getAlignment());
				s.getComponent(1).setFieldName("MyComponentOne");

				assertTrue(s.hasDefaultPacking());
				assertTrue(s.isDefaultAligned());

				assertEquals(0, s.getComponent(0).getOffset());
				assertEquals(2, s.getComponent(1).getOffset());
				assertEquals("MyComponentOne", s.getComponent(1).getFieldName());
				assertEquals(4, s.getComponent(2).getOffset());
				assertEquals(8, s.getComponent(3).getOffset());
				assertEquals(16, s.getLength());
				assertEquals(4, s.getAlignment());
			}

			@Override
			public void modifyPrivate(ProgramDB program) throws Exception {
				DataTypeManager dtm = program.getDataTypeManager();

				Structure s =
					(Structure) dtm.getDataType(new CategoryPath("/Category1/Category2/Category3"),
						"IntStruct");
				assertEquals(16, s.getLength());
				assertEquals(4, s.getAlignment());
				s.pack(1);

				assertEquals(0, s.getComponent(0).getOffset());
				assertEquals(1, s.getComponent(1).getOffset());
				assertEquals(3, s.getComponent(2).getOffset());
				assertEquals(7, s.getComponent(3).getOffset());
				assertEquals(15, s.getLength());
				assertEquals(1, s.getAlignment());
			}
		});
	}
Data type merge tests for aligned data types.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/datatypes/DataTypeMerge6Test.java