Skip to content

Commit

Permalink
[703] fix NPE when no build binaries on system PATH
Browse files Browse the repository at this point in the history
- fix unit test

fixes eclipse-cdt#703
  • Loading branch information
ghentschke committed Feb 9, 2024
1 parent 98d1599 commit 68178da
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.List;

Expand Down Expand Up @@ -62,10 +61,12 @@ public void getBinaryParserIdsTest00() throws Exception {
/*
* It's difficult to create a functional BuildConfiguration without a toolchain, so just use
* this Error Build Configuration. It is adequate for simply testing the API.
*
* Edit: getBinaryParserIds() must not return null to prevent possible NPE
*/
ErrorBuildConfiguration errorBuildConfiguration = new ErrorBuildConfiguration(buildConfig, "errorBuildConfig");
List<String> binaryParserIds = errorBuildConfiguration.getBinaryParserIds();
assertNull(binaryParserIds, "Must be null");
assertNotNull(binaryParserIds, "Must not be null");
}

private IProject getProject() throws Exception {
Expand Down

0 comments on commit 68178da

Please sign in to comment.