mirror of https://github.com/ceph/go-ceph
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:
parent
29c18bcfd0
commit
961ff19bfd
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue