mnemonikr / symbolic-pcode

Apache License 2.0
0 stars 0 forks source link

Improve test coverage for module unit tests #88

Open mnemonikr opened 8 months ago

mnemonikr commented 8 months ago

In #87 a bug was discovered during PR since the memory module didn't cover branches that were covered by integration tests. It's good that the integration test caught the issue, but it was actually a simple issue that should have been caught by a unit test (reading from constant address space). Added code to handle the case but not a unit test. There are likely other branches not well covered by unit tests.

Should document existing coverage for all modules in this issue and then improve as necessary. Once improved issue may be resolved.

mnemonikr commented 8 months ago

104 improves coverage a bit . Once that's merged, coverage should be -- based on cargo llvm-cov --workspace:

Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sla/src/ffi/rust.rs                 8                 0   100.00%           3                 0   100.00%          24                 0   100.00%           0                 0         -
sla/src/ffi/sys.rs                 55                16    70.91%          49                13    73.47%          54                18    66.67%           0                 0         -
sla/src/opcodes.rs                226                21    90.71%          46                18    60.87%         221                19    91.40%           0                 0         -
sla/src/sleigh.rs                 175                54    69.14%          62                22    64.52%         436                55    87.39%           0                 0         -
src/emulator.rs                  1613               493    69.44%         169                10    94.08%        2604                96    96.31%           0                 0         -
src/mem.rs                        176                58    67.05%          34                 9    73.53%         379                82    78.36%           0                 0         -
src/processor.rs                   78                24    69.23%          19                 7    63.16%         136                21    84.56%           0                 0         -
sym/src/buf.rs                    127                20    84.25%          64                10    84.38%         283                53    81.27%           0                 0         -
sym/src/convert.rs                155                 9    94.19%          68                 0   100.00%         328                 3    99.09%           0                 0         -
sym/src/sym.rs                    497                67    86.52%         156                11    92.95%        1015                81    92.02%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            3110               762    75.50%         670               100    85.07%        5480               428    92.19%           0                 0         -