implements: don't panic if no counts for C functions are avaiable

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-09-21 14:44:39 -04:00 committed by mergify[bot]
parent 29c18bcfd0
commit 961ff19bfd
1 changed files with 8 additions and 3 deletions

View File

@ -51,19 +51,24 @@ func (r *TextReport) Report(name string, ii *Inspector) error {
found := len(ii.found)
total := len(ii.expected)
missing := total - found - ii.deprecatedMissing
var percentFound, percentMissing int
if total > 0 {
percentFound = (100 * found) / total
percentMissing = (100 * missing) / total
}
r.printf(
"%s functions covered: %d/%d : %v%%\n",
packageLabel,
found,
total,
(100*found)/total)
missing := total - found - ii.deprecatedMissing
percentFound)
r.printf(
"%s functions missing: %d/%d : %v%%\n",
packageLabel,
missing,
total,
(100*missing)/total)
percentMissing)
r.printf(
" (note missing count does not include deprecated functions in ceph)\n")