* "debug" property defined. Return value from getActiveDefines should
* contain one member
*/
public void testGetActiveDefines() {
Project project = new org.apache.tools.ant.Project();
CompilerDef def = new CompilerDef();
def.setProject(project);
DefineSet defset = new DefineSet();
DefineArgument arg1 = new DefineArgument();
arg1.setName("DEBUG");
arg1.setIf("debug");
defset.addDefine(arg1);
DefineArgument arg2 = new DefineArgument();
arg2.setName("NDEBUG");
arg2.setUnless("debug");
defset.addDefine(arg2);
def.addConfiguredDefineset(defset);
//
// Evaluate without "debug" set
//
UndefineArgument[] activeArgs = def.getActiveDefines();
assertEquals(1, activeArgs.length);
assertEquals("NDEBUG", activeArgs[0].getName());
//
// Set the "debug" property
//
project.setProperty("debug", "");
activeArgs = def.getActiveDefines();
assertEquals(1, activeArgs.length);
assertEquals("DEBUG", activeArgs[0].getName());
}