public void testIfdef() throws PreprocessException {
public void testIfdef() throws BuildException {
	public void testIfdef() throws PreprocessException {		String[] sourceLines = new String[] {			"	//#ifdef test1 ",			"	String hello =  \"test1 is defined\";",			"	//#else",			"	//# String hello =  \"test1 is not defined\";",			"	//#endif",			"	System.out.println( hello );"		};		StringList lines = new StringList( sourceLines );		int result  = this.preprocessor.preprocess( "MyClass.java", lines );		assertEquals( Preprocessor.NOT_CHANGED,  result );		/*		String[] processedLines = lines.getArray();		for (int i = 0; i < processedLines.length; i++) {			System.out.println( processedLines[i] );		}		System.out.println("=========================");		*/		sourceLines = new String[] {				"	//#ifdef XXtest1 ",				"	String hello =  \"XXtest1 is defined\";",				"	//#else",				"	//# String hello =  \"XXtest1 is not defined\";",				"	//#endif",				"	System.out.println( hello );"		};		lines = new StringList( sourceLines );		result = this.preprocessor.preprocess( "MyClass.java", lines );		assertEquals( Preprocessor.CHANGED, result );		/*		processedLines = lines.getArray();		System.out.println("#ifdef test");		for (int i = 0; i < processedLines.length; i++) {			System.out.println( processedLines[i] );		}		*/		sourceLines = new String[] {				"	//#ifdef XXtest1 ",				"	String hello =  \"XXtest1 is defined\";",				"	//#else",				"	//# String hello =  \"XXtest1 is not defined\";",				"	System.out.println( hello );"		};		lines = new StringList( sourceLines );		try {			this.preprocessor.preprocess( "MyClass.java", lines );			fail("PreprocessException should be thrown when #endif is missing.");		} catch (PreprocessException e) {			// expected behaviour!		}		// check inner #ifdef    (1):		sourceLines = new String[] {				"	//#ifdef test1 ",				"	String hello =  \"test1 is defined\";",				"		//#ifdef test2 ",				"		hello =  \"test2 is defined\";",				"		//#endif",				"	//#else",				"	//# String hello =  \"test1 is not defined\";",				"		//#ifdef test2 ",				"		//# hello +=  \" - but test2 is defined\";",				"		//#endif",				"	//#endif",				"	System.out.println( hello );"		};		lines = new StringList( sourceLines );		result = this.preprocessor.preprocess( "MyClass.java", lines );		assertEquals( Preprocessor.NOT_CHANGED, result );				// check inner #ifdef    (2):		sourceLines = new String[] {				"	//#ifdef XXtest1 ",				"	String hello =  \"XXtest1 is defined\";",				"		//#ifdef test2 ",				"		hello =  \"test2 is defined\";",				"		//#endif",				"	//#else",				"	//# String hello =  \"XXtest1 is not defined\";",				"		//#ifdef test2 ",				"		//# hello +=  \" - but test2 is defined\";",				"		//#endif",				"	//#endif",				"	System.out.println( hello );"		};		lines = new StringList( sourceLines );		result = this.preprocessor.preprocess( "MyClass.java", lines );		assertEquals( Preprocessor.CHANGED, result );				// check inner #ifdef    (3 - with syntax error):		sourceLines = new String[] {				"	//#ifdef test1 ",				"	String hello =  \"test1 is defined\";",				"		//#ifdef test2 ",				"		hello =  \"test2 is defined\";",				"		//#endif",				"	//#else",				"	//# String hello =  \"test1 is not defined\";",				"		//#ifdefk test2 ",				"		//# hello +=  \" - but test2 is defined\";",				"		//#endif",				"	//#endif",				"	System.out.println( hello );"		};		lines = new StringList( sourceLines );		try {			result = this.preprocessor.preprocess( "MyClass.java", lines );			fail( "preprocessing should fail when encountering syntax error within inactive if-block." );		} catch (PreprocessException e) {			// expected behaviour		}			}