@Test
	public void testPointerTypedefAutoNaming() throws Exception {

		DataType st = dtm.resolve(new StructureDataType("foo", 10), null);

		DataType dt = new PointerTypedef(null, st, -1, dtm,
			program.getAddressFactory().getRegisterSpace());
		assertFalse(dt.hasLanguageDependantLength());
		assertEquals(2, dt.getLength());
		assertTrue(dt instanceof TypeDef);
		assertEquals("foo *16 " + formatAttributes("space(register)"), dt.getName());
		DataType dbDt = dtm.resolve(dt, null);
		assertTrue(dbDt instanceof TypeDef);
		assertTrue(dbDt instanceof DatabaseObject); // transforms to TypedefDB
		assertTrue(dt.isEquivalent(dbDt));
		assertEquals(dt.getName(), dbDt.getName());

		st.setName("bob");

		// auto-name should update
		assertEquals("bob *16 " + formatAttributes("space(register)"), dbDt.getName());

		Settings settings = dbDt.getDefaultSettings();

		OffsetMaskSettingsDefinition.DEF.setValue(settings, 0x123456789abcdef0L);
		assertEquals("bob *16 " + formatAttributes("space(register),mask(0x123456789abcdef0)"),
			dbDt.getName());

		ComponentOffsetSettingsDefinition.DEF.setValue(settings, 0x123);
		assertEquals(
			"bob *16 " + formatAttributes("space(register),mask(0x123456789abcdef0),offset(0x123)"),
			dbDt.getName());

		OffsetShiftSettingsDefinition.DEF.setValue(settings, 16);
		assertEquals(
			"bob *16 " + formatAttributes(
				"space(register),mask(0x123456789abcdef0),shift(16),offset(0x123)"),
			dbDt.getName());

		PointerTypeSettingsDefinition.DEF.setType(settings, PointerType.IMAGE_BASE_RELATIVE);
		assertEquals(
			"bob *16 " + formatAttributes(
				"image-base-relative,space(register),mask(0x123456789abcdef0),shift(16),offset(0x123)"),
			dbDt.getName());

		st.setName("bill");
		assertEquals(
			"bill *16 " + formatAttributes(
				"image-base-relative,space(register),mask(0x123456789abcdef0),shift(16),offset(0x123)"),
			dbDt.getName());

		PointerTypeSettingsDefinition.DEF.clear(settings);
		assertEquals(
			"bill *16 " + formatAttributes(
				"space(register),mask(0x123456789abcdef0),shift(16),offset(0x123)"),
			dbDt.getName());

		ComponentOffsetSettingsDefinition.DEF.clear(settings);
		assertEquals(
			"bill *16 " + formatAttributes("space(register),mask(0x123456789abcdef0),shift(16)"),
			dbDt.getName());

		// NOTE: Changing address space setting will not alter pointer size

		AddressSpaceSettingsDefinition.DEF.clear(settings);
		assertEquals(
			"bill *16 " + formatAttributes("mask(0x123456789abcdef0),shift(16)"),
			dbDt.getName());

		OffsetShiftSettingsDefinition.DEF.clear(settings);
		assertEquals(
			"bill *16 " + formatAttributes("mask(0x123456789abcdef0)"),
			dbDt.getName());

	}
Tests for manipulating data types in the category/data type tree.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/model/data/PointerTypedefDataTypeTest.java