@@ -57,39 +57,47 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti
5757 }
5858
5959 @ Test
60- void polyspaceCPTest () {
60+ void shouldReadCPTestResults () {
6161 var warnings = parse ("polyspace_cp.csv" );
6262 assertThat (warnings ).hasSize (4 );
6363
64- try (var softly = new SoftAssertions ()) {
65- softly .assertThat (warnings .get (0 )).hasLineStart (30 )
64+ assertThat (warnings .get (0 )).hasLineStart (30 )
6665 .hasFileName ("D:/workspace/math.c" )
6766 .hasCategory ("Data flow" )
6867 .hasDescription ("Run-time Check" )
6968 .hasMessage ("Check: Unreachable code" )
7069 .hasModuleName ("xinitialize()" )
7170 .hasColumnStart (4 )
7271 .hasSeverity (Severity .WARNING_HIGH );
73- softly . assertThat (warnings .get (1 )).hasLineStart (34 )
72+ assertThat (warnings .get (1 )).hasLineStart (34 )
7473 .hasFileName ("D:/sample.h" )
7574 .hasCategory ("Data flow" )
7675 .hasDescription ("Run-time Check" )
7776 .hasModuleName ("method_a()" )
7877 .hasColumnStart (4 )
7978 .hasSeverity (Severity .WARNING_NORMAL );
80- softly . assertThat (warnings .get (2 )).hasLineStart (66 )
79+ assertThat (warnings .get (2 )).hasLineStart (66 )
8180 .hasDescription ("Run-time Check" )
8281 .hasModuleName ("errorCheck()" )
8382 .hasColumnStart (4 )
8483 .hasSeverity (Severity .WARNING_HIGH );
85- softly . assertThat (warnings .get (3 )).hasLineStart (217 )
84+ assertThat (warnings .get (3 )).hasLineStart (217 )
8685 .hasDescription ("MISRA C:2012" )
8786 .hasMessage ("Check: 10.1 Operands shall not be of an inappropriate essential type. Category: Required" )
8887 .hasFileName ("/file/SERVICE.c" )
8988 .hasModuleName ("a_message()" )
9089 .hasColumnStart (27 )
9190 .hasCategory ("10 The essential type model" )
9291 .hasSeverity (Severity .WARNING_NORMAL );
93- }
92+ }
93+
94+ @ Test
95+ @ org .junitpioneer .jupiter .Issue ("https://github.com/jenkinsci/analysis-model/issues/1490" )
96+ void shouldHandleBrokenFiles () {
97+ var warnings = parseStringContent ("""
98+ Header
99+ broken\t input\t file
100+ """ );
101+ assertThat (warnings ).isEmpty ();
94102 }
95103}
0 commit comments