mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
Fixed broken test.
This commit is contained in:
parent
a54b8f71ac
commit
ac690f85bf
1 changed files with 17 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 QNX Software Systems and others.
|
* Copyright (c) 2006, 2010 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -11,6 +11,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.pdom.tests;
|
package org.eclipse.cdt.internal.pdom.tests;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
@ -29,7 +31,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class EnumerationTests extends PDOMTestBase {
|
public class EnumerationTests extends PDOMTestBase {
|
||||||
|
|
||||||
|
@ -60,6 +61,12 @@ public class EnumerationTests extends PDOMTestBase {
|
||||||
assertEquals("TestCEnum", enumeration.getName());
|
assertEquals("TestCEnum", enumeration.getName());
|
||||||
IEnumerator[] enumerators = enumeration.getEnumerators();
|
IEnumerator[] enumerators = enumeration.getEnumerators();
|
||||||
assertEquals(3, enumerators.length);
|
assertEquals(3, enumerators.length);
|
||||||
|
// Enumerators are returned in arbitrary order. Sort them to make checking easier.
|
||||||
|
Arrays.sort(enumerators, new Comparator<IEnumerator>() {
|
||||||
|
public int compare(IEnumerator o1, IEnumerator o2) {
|
||||||
|
return o1.getName().compareTo(o2.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
assertEquals("ca", enumerators[0].getName());
|
assertEquals("ca", enumerators[0].getName());
|
||||||
assertEquals("cb", enumerators[1].getName());
|
assertEquals("cb", enumerators[1].getName());
|
||||||
assertEquals("cc", enumerators[2].getName());
|
assertEquals("cc", enumerators[2].getName());
|
||||||
|
@ -92,6 +99,12 @@ public class EnumerationTests extends PDOMTestBase {
|
||||||
assertEquals("TestCPPEnum", enumeration.getName());
|
assertEquals("TestCPPEnum", enumeration.getName());
|
||||||
IEnumerator[] enumerators = enumeration.getEnumerators();
|
IEnumerator[] enumerators = enumeration.getEnumerators();
|
||||||
assertEquals(3, enumerators.length);
|
assertEquals(3, enumerators.length);
|
||||||
|
// Enumerators are returned in arbitrary order. Sort them to make checking easier.
|
||||||
|
Arrays.sort(enumerators, new Comparator<IEnumerator>() {
|
||||||
|
public int compare(IEnumerator o1, IEnumerator o2) {
|
||||||
|
return o1.getName().compareTo(o2.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
assertEquals("cppa", enumerators[0].getName());
|
assertEquals("cppa", enumerators[0].getName());
|
||||||
assertEquals("cppb", enumerators[1].getName());
|
assertEquals("cppb", enumerators[1].getName());
|
||||||
assertEquals("cppc", enumerators[2].getName());
|
assertEquals("cppc", enumerators[2].getName());
|
||||||
|
@ -114,5 +127,4 @@ public class EnumerationTests extends PDOMTestBase {
|
||||||
loc = aRefs[0].getFileLocation();
|
loc = aRefs[0].getFileLocation();
|
||||||
assertEquals(offset("enumTest.cpp", "cppa;"), loc.getNodeOffset());
|
assertEquals(offset("enumTest.cpp", "cppa;"), loc.getNodeOffset());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue