mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
cleanup: reformatting
This commit is contained in:
parent
7a0719bfba
commit
2f140d6523
1 changed files with 24 additions and 15 deletions
|
@ -224,17 +224,16 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
public void testMacroOptL(){
|
public void testMacroOptL() {
|
||||||
doInit();
|
doInit();
|
||||||
IToolChain tc = cfgs[0].getToolChain();
|
ITool t = cfgs[0].getTools()[0];
|
||||||
ITool t = cfgs[0].getTools()[0];
|
IOption opt = t.getOptionById(OPT_IDL);
|
||||||
IOption opt = t.getOptionById(OPT_IDL);
|
OptionContextData ocd = new OptionContextData(opt, t);
|
||||||
OptionContextData ocd = new OptionContextData(opt,t);
|
|
||||||
assertNotNull(opt);
|
assertNotNull(opt);
|
||||||
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, ocd);
|
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, ocd);
|
||||||
assertNotNull(ms);
|
assertNotNull(ms);
|
||||||
assertEquals(ms.length, 1);
|
assertEquals(ms.length, 1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String[] set0 = opt.getStringListValue();
|
String[] set0 = opt.getStringListValue();
|
||||||
assertNotNull(set0);
|
assertNotNull(set0);
|
||||||
|
@ -243,24 +242,34 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
String[] res1 = {"new a", /*"test=CFGTEST",*/ "x", "y", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
String[] res1 = {"new a", /*"test=CFGTEST",*/ "x", "y", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||||
"z", ":", "PRJ=NewMacrosForProjectContext", "LIST=x|y|z"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
"z", ":", "PRJ=NewMacrosForProjectContext", "LIST=x|y|z"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||||
try {
|
try {
|
||||||
res1[4] = mp.resolveValue("${PATH}",UNKNOWN,LISTSEP,IBuildMacroProvider.CONTEXT_OPTION, ocd); //$NON-NLS-1$
|
res1[4] = mp.resolveValue("${Path}", UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, ocd); //$NON-NLS-1$
|
||||||
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
} catch (BuildMacroException e) {
|
||||||
|
fail(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
opt = cfgs[0].setOption(t, opt, set1);
|
opt = cfgs[0].setOption(t, opt, set1);
|
||||||
assertNotNull(opt);
|
assertNotNull(opt);
|
||||||
|
|
||||||
ArrayList<String> ar = new ArrayList<String>(1);
|
ArrayList<String> ar = new ArrayList<String>(1);
|
||||||
for (int i=0; i<set1.length; i++) {
|
for (int i = 0; i < set1.length; i++) {
|
||||||
try {
|
try {
|
||||||
String[] aus = mp.resolveStringListValue(set1[i], UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t));
|
String[] aus = mp.resolveStringListValue(set1[i], UNKNOWN, LISTSEP,
|
||||||
if (aus == null) continue;
|
IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt, t));
|
||||||
for (int j=0; j<aus.length; j++) ar.add(aus[j]);
|
if (aus == null)
|
||||||
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
continue;
|
||||||
|
for (int j = 0; j < aus.length; j++)
|
||||||
|
ar.add(aus[j]);
|
||||||
|
} catch (BuildMacroException e) {
|
||||||
|
fail(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String[] res = ar.toArray(new String[0]);
|
String[] res = ar.toArray(new String[0]);
|
||||||
assertEquals(res.length, res1.length);
|
assertEquals(res.length, res1.length);
|
||||||
for (int i=0; i<res.length; i++) assertEquals(res[i], res1[i]);
|
for (int i = 0; i < res.length; i++)
|
||||||
} catch (BuildException e) { fail(e.getLocalizedMessage()); }
|
assertEquals(res[i], res1[i]);
|
||||||
|
} catch (BuildException e) {
|
||||||
|
fail(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue