1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Cosmetic changes to unit test

Instead of using assertTrue, but assertEquals we get nice
error messages that show the contents of the collections.

Using assertEquals(List.of() instead of assertArrayEquals(...
because that gives nicer error messages.

Part of #117
This commit is contained in:
Jonah Graham 2022-10-28 13:40:12 -04:00
parent 542e8b474e
commit 71eae6c2d3

View file

@ -14,6 +14,8 @@
package org.eclipse.cdt.make.scannerdiscovery;
import java.io.ByteArrayInputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCProjectNature;
@ -80,9 +82,9 @@ public class ScannerConfigDiscoveryTests extends BaseTestCase {
IScannerInfo scInfo = CCorePlugin.getDefault().getScannerInfoProvider(fCProject).getScannerInformation(fCFile);
assertNotNull(scInfo);
String[] includes = scInfo.getIncludePaths();
assertTrue(includes.length == 0);
assertEquals(List.of(), Arrays.asList(includes));
Map<String, String> symbols = scInfo.getDefinedSymbols();
assertTrue(symbols.isEmpty());
assertEquals(Map.of(), symbols);
}
public void testGetCCCompilerBuiltins() throws CoreException {
@ -94,9 +96,9 @@ public class ScannerConfigDiscoveryTests extends BaseTestCase {
IScannerInfo scInfo = CCorePlugin.getDefault().getScannerInfoProvider(fCProject).getScannerInformation(fCFile);
assertNotNull(scInfo);
String[] includes = scInfo.getIncludePaths();
assertTrue(includes.length == 0);
assertEquals(List.of(), Arrays.asList(includes));
Map<String, String> symbols = scInfo.getDefinedSymbols();
assertTrue(symbols.isEmpty());
assertEquals(Map.of(), symbols);
}
}