From 71eae6c2d3a9532cab6c718a8d9c8b993d11f0d4 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 28 Oct 2022 13:40:12 -0400 Subject: [PATCH] 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 --- .../scannerdiscovery/ScannerConfigDiscoveryTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java index 0ad79b38587..16cbee69872 100644 --- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java +++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java @@ -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 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 symbols = scInfo.getDefinedSymbols(); - assertTrue(symbols.isEmpty()); + assertEquals(Map.of(), symbols); } }