apavlenko / vmf

http://01org.github.io/vmf/
Apache License 2.0
0 stars 3 forks source link

Test code coverage #39

Closed apavlenko closed 8 years ago

apavlenko commented 8 years ago

All possible VMF code (excluding 3rd-party one, like XMP, libXML2, etc) should be covered by the project tests set; all the uncovered parts should be clearly justified. The existing automated code coverage infra (https://coveralls.io/github/apavlenko/vmf and https://codecov.io/github/apavlenko/vmf) is recommended for use for this task.

NOTE: the resulting coverage should be 80+%

anna-khakimova commented 8 years ago

In most JNI function's catch blocks can not be tested because exceptions in theses function can not be generated by any induced test scenarios.

anna-khakimova commented 8 years ago

In file global.cpp line 70-72 can not be tested because this code works only if system function return error code (-1).

anna-khakimova commented 8 years ago

In metadataset.cpp line 67 can not be tested because to Metadata class instance field 'm_vReferences' can not be added reference with null pointer instead of shared pointer to Metadata class instance. Since Reference instances are created and added to 'm_vReferences' field only via Metadata::addReference() method which have check reference's Metadata isn't null.

anna-khakimova commented 8 years ago

In metadata.cpp line 119 can not be tested because Metadata class instance field 'm_nNumOfFrames' can not ever become < 0.

anna-khakimova commented 8 years ago

In metadata.cpp lines 425, 448, 508 can not be tested because Metadata class instance field 'm_spDesc' can not be ever null pointer.

anna-khakimova commented 8 years ago

In metadatastream.cpp lines 380 and 418 can not be tested because MetadataSchema instance's field 'Name' can not be wherever set to empty.

anna-khakimova commented 8 years ago

In https://github.com/anna-plyakina/vmf/blob/vmf_improve_test_coverage2/modules/vmfcore/src/metadatastream.cpp#L693 and 705 can not be tested because VideoSegment instance's fields "duration", "height", "width" can not be ever set to negative value.

apavlenko commented 8 years ago

the final coverage result is 77.57% (+13.48%).