@Test
	public void testNullTermination() throws Exception {

		Program testProgram = buildProgram("msvidctl.dll", false);

		Listing listing = testProgram.getListing();
		AddressSpace space = testProgram.getLanguage().getAddressFactory().getDefaultAddressSpace();

		String[] existingStrings = new String[] { "KeyPress", "FriendlyName", "RemoteWriteW",
			"Longitude in tenths of a degreeWWW",
			"Returns an enumerator for Tuning Spaces accepted by this tuner" };
		int[] offsets = new int[] { 0x5a2afc20, 0x5a2b00e4, 0x5a2b0384, 0x5a2cdafe, 0x5a2cdcd2 };
		Address[] existingAddresses = new Address[offsets.length];

		for (int i = 0; i < offsets.length; i++) {
			existingAddresses[i] = addr(space, offsets[i]);
		}

		Data dataHere;

		// Verify none of these strings are here before running Strings Analyzer
		for (Address currAddress : existingAddresses) {
			dataHere = listing.getDefinedDataAt(currAddress);
			assertNull(dataHere);
		}

		// Verify that these strings are not created when the options is checked
		AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(testProgram);

		StringsAnalyzer analyzer = new StringsAnalyzer();
		analyzer.setRequireNullTermination(true);
		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		for (Address currAddress : existingAddresses) {
			dataHere = listing.getDefinedDataAt(currAddress);
			assertNull(dataHere);
		}

		analyzer.setRequireNullTermination(false);
		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		String stringHere;

		for (int i = 0; i < existingStrings.length; i++) {
			// Verify string is actually there
			dataHere = listing.getDefinedDataAt(existingAddresses[i]);
			assertNotNull(dataHere);
			stringHere = dataHere.getDefaultValueRepresentation();

			assertEquals("\"" + existingStrings[i] + "\"", stringHere);
		}
	}
Test that unchecking the "Require null termination for string" parameter works -- strings
that are valid strings, but don't end in null bytes should be created.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/StringsAnalyzerTest.java