Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000774Taste[All Projects] ASN.1 Compiler v4public2018-05-16 16:082019-09-29 15:48
Reporterttsiodras 
Assigned Togmamais 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000774:

Coverage results of -atc have worsened since v3

Description

Using this grammar (part of the DMT regression checks)...

https://raw.githubusercontent.com/ttsiodras/DataModellingTools/master/tests-coverage/DataTypesSimulink.asn [^]

...the output of the coverage tests have regressed since v3:

$ asn1.exe -c -uPER -atc DataTypesSimulink.asn
$ gcc -Wall -Wextra *.c

(this reports many unused parameters - please add the necessary

(void)pVal;

...to avoid these warnings. But more importantly, the coverage result is far worse than what it used to be:

$ make coverage
...
$ ./mainprogram
All test cases (200) run successfully.

$ gcov DataTypesSimulink.c
File 'DataTypesSimulink.c'
Lines executed:95.91% of 2076
Creating 'DataTypesSimulink.c.gcov'

There are many lines that are no longer covered...

Steps To Reproduce

Using this grammar (part of the DMT regression checks)...

https://raw.githubusercontent.com/ttsiodras/DataModellingTools/master/tests-coverage/DataTypesSimulink.asn [^]

...the output of the coverage tests have regressed since v3:

$ asn1.exe -c -uPER -atc DataTypesSimulink.asn
$ gcc -Wall -Wextra *.c

(this reports many unused parameters - please add the necessary

(void)pVal;

...to avoid these warnings. But more importantly, the coverage result is far worse than what it used to be:

$ make coverage
...
$ ./mainprogram
All test cases (200) run successfully.

$ gcov DataTypesSimulink.c
File 'DataTypesSimulink.c'
Lines executed:95.91% of 2076
Creating 'DataTypesSimulink.c.gcov'

There are many lines that are no longer covered...

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003655)
gmamais (developer)
2019-09-29 15:48

Warnings have been removed
- C programs are now compiled with the following gcc arguments:
-Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef
i.e. all warnings are enabled and warnings are treated as errors
- Ada programs are compiled with the following gnat arguments
-gnatwe -gnatwa
i.e. warnings are treated as errors and enable all warnings

Regarding statement coverage:
Statement coverage has been greatly improved. The python script checks again for statement coverage and if less than 100% (ignoring, of course, those lines marked as COVERAGE_IGNORE) then the test case fails.
However, it is not always possible to generate automatic test cases that cover 100% of the code.
For example, suppose the following two types (taken from the attached file which has one such case)
'''
TypeWithOptional ::= SEQUENCE {
a BOOLEAN OPTIONAL,
b INTEGER (0..255|1299),
c INTEGER (0..255),
d T-TypeThatMustNotBeMappedExceptInPython DEFAULT {config "Config", param 5, fixstr "World"}
}

SubTypeWithOptional ::= TypeWithOptional (WITH COMPONENTS {a ABSENT, c (42), b (1299)})

'''

In uPER, the decoding of SubTypeWithOptional is exactly like with TypeWithOptional because the WITH COMPONENT constraint is not uPER visible.
So, the decoding function will have the following lines
'''
--Decode a
if val.Exist.a = 1 then
result.ErrorCode := ERR_UPER_DECODE_SUBTYPEWITHOPTIONAL_A;
adaasn1rtl.encoding.uper.UPER_Dec_boolean(bs, val.a, result.Success);
end if;
'''
However, no test case is generated with value in a child (it would fail in encoding) so the lines within the if statement are never executed.
Please note that these two lines cannot be marked as COVERAGE_IGNORE because the content is not fixed (i.e. depends on the child type which may be very complex.
These grammars are marked as --NOCOVERAGE to avoid statement coverage testing.


- Issue History
Date Modified Username Field Change
2018-05-16 16:08 ttsiodras New Issue
2018-05-16 16:08 ttsiodras Status

new => assigned

2018-05-16 16:08 ttsiodras Assigned To

=> gmamais

2019-09-29 15:48 gmamais Note Added: 0003655
2019-09-29 15:48 gmamais Status

assigned => resolved

2019-09-29 15:48 gmamais Resolution

open => fixed



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker