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)
|
found := len(ii.found)
|
||||||
total := len(ii.expected)
|
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(
|
r.printf(
|
||||||
"%s functions covered: %d/%d : %v%%\n",
|
"%s functions covered: %d/%d : %v%%\n",
|
||||||
packageLabel,
|
packageLabel,
|
||||||
found,
|
found,
|
||||||
total,
|
total,
|
||||||
(100*found)/total)
|
percentFound)
|
||||||
missing := total - found - ii.deprecatedMissing
|
|
||||||
r.printf(
|
r.printf(
|
||||||
"%s functions missing: %d/%d : %v%%\n",
|
"%s functions missing: %d/%d : %v%%\n",
|
||||||
packageLabel,
|
packageLabel,
|
||||||
missing,
|
missing,
|
||||||
total,
|
total,
|
||||||
(100*missing)/total)
|
percentMissing)
|
||||||
r.printf(
|
r.printf(
|
||||||
" (note missing count does not include deprecated functions in ceph)\n")
|
" (note missing count does not include deprecated functions in ceph)\n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue