mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-16 12:28:48 +02:00
Prevent division by zero if no tests
This commit is contained in:
parent
53f70ac43b
commit
08f473ffef
@ -325,7 +325,10 @@ class HTMLReportWriter(ReportWriter):
|
|||||||
(self.bcounter, self.total_tcounter, self.total_fcounter, self.total_tcounter - self.total_fcounter))
|
(self.bcounter, self.total_tcounter, self.total_fcounter, self.total_tcounter - self.total_fcounter))
|
||||||
self.oprint ('<td align="right">%f</td>\n' % self.total_duration)
|
self.oprint ('<td align="right">%f</td>\n' % self.total_duration)
|
||||||
self.oprint ('<td align="center">-</td>\n')
|
self.oprint ('<td align="center">-</td>\n')
|
||||||
perc = (self.total_tcounter - self.total_fcounter) * 100.0 / self.total_tcounter
|
if self.total_tcounter != 0:
|
||||||
|
perc = (self.total_tcounter - self.total_fcounter) * 100.0 / self.total_tcounter
|
||||||
|
else:
|
||||||
|
perc = 0.0
|
||||||
pcolor = {
|
pcolor = {
|
||||||
100 : 'bgcolor="lightgreen"',
|
100 : 'bgcolor="lightgreen"',
|
||||||
0 : 'bgcolor="red"',
|
0 : 'bgcolor="red"',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user