@Test
	public void testCreateStringsInAccessibleMemoryBlocksOnly() throws Exception {

		Program testProgram = buildProgram("xtraceroute", false);

		Listing listing = testProgram.getListing();

		// These inaccessible strings will be in the .comment address space/memory block
		String[] inaccessibleStrings =
			new String[] { "GCC: (GNU) 3.2 20020720 (Red Hat Linux Rawhide 3.2-0.1)",
				"GCC: (GNU) 3.2 20020720 (Red Hat Linux Rawhide 3.2-0.1.1)" };
		int[] offsets = new int[] { 0x00000001, 0x000002fc };

		String[] accessibleStrings =
			new String[] { "Anguilla", "Q80@AT", "Bosnia and Herzegowina", "Kingdom of Sweden" };
		int[] offsets2 = new int[] { 0x08057b60, 0x08057e38, 0x08057fb0, 0x0805bc6c };
		boolean[] shouldExist = new boolean[] { true, false, true, true };

		AddressSpace space = testProgram.getLanguage().getAddressFactory().getDefaultAddressSpace();

		Address[] inaccessibleAddresses = new Address[offsets.length];
		Address[] accessibleAddresses = new Address[offsets2.length];

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

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

		Data dataHere;

		// Verify none of the strings exist prior to running the Strings Analyzer
		for (Address currAddress : inaccessibleAddresses) {
			dataHere = listing.getDefinedDataAt(currAddress);
			assertNull(dataHere);
		}

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

		AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(testProgram);

		// Set to search only accessible memory blocks. We don't expect to find the
		// 'inaccessible' strings in this case.
		StringsAnalyzer analyzer = new StringsAnalyzer();
		analyzer.setSearchAccessibleMemoryBlocks(true);
		analyzer.setStringEndAlignment(1);
		analyzer.setRequireNullTermination(false);
		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		// Verify the inaccessible strings still don't exist
		for (Address currAddress : inaccessibleAddresses) {
			dataHere = listing.getDefinedDataAt(currAddress);
			assertNull(dataHere);
		}

		// But most of the accessible strings should exist
		String stringHere;

		for (int i = 0; i < accessibleAddresses.length; i++) {
			dataHere = listing.getDefinedDataAt(accessibleAddresses[i]);

			if (shouldExist[i]) {
				assertNotNull(dataHere);
				stringHere = dataHere.getDefaultValueRepresentation();

				// String will look something like --> "My String",00
				String buildMyString = "\"" + accessibleStrings[i] + "\"";
				assertEquals(buildMyString, stringHere);
			}
			else {
				assertNull(dataHere);
			}
		}

		// Set to search all memory blocks
		analyzer.setSearchAccessibleMemoryBlocks(false);
		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		for (int i = 0; i < inaccessibleStrings.length; i++) {
			// Verify formerly inaccessible strings are now there
			dataHere = listing.getDefinedDataAt(inaccessibleAddresses[i]);
			assertNotNull(dataHere);
			stringHere = dataHere.getDefaultValueRepresentation();

			// String will look something like --> "My String",00
			String buildMyString = "\"" + inaccessibleStrings[i] + "\"";
			assertEquals(buildMyString, stringHere);
		}
	}
Test that enabling "Search only in accessible memory blocks" only looks for strings
in memory blocks that have one or more of the R, W, or X permissions set.

Test that disabling the option allows strings to be made in all memory blocks regardless
of permissions.

@throws Exception
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/StringsAnalyzerTest.java