From 8c2c30e4b8beadee406e139493d402f2c3652ae3 Mon Sep 17 00:00:00 2001 From: gary_williams <gary_williams@localhost> Date: Thu, 10 May 2007 15:45:54 +0000 Subject: [PATCH] Fix Issue 1232 divide by zero error in test report stylesheet --- opends/tests/functional-tests/shared/xsl/gen-alltests-report.xsl | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/opends/tests/functional-tests/shared/xsl/gen-alltests-report.xsl b/opends/tests/functional-tests/shared/xsl/gen-alltests-report.xsl index ae803d2..127884d 100644 --- a/opends/tests/functional-tests/shared/xsl/gen-alltests-report.xsl +++ b/opends/tests/functional-tests/shared/xsl/gen-alltests-report.xsl @@ -41,7 +41,17 @@ <xsl:variable name="fail-tests" select="count($testcase[@result='fail'])"/> <xsl:variable name="inconc-tests" select="count($testcase[@result='unknown'])"/> - <xsl:variable name="percent-tests" select="round((($pass-tests div $total-tests) * 100) - 0.5)"/> + <!-- Overall Test Percentage --> + <xsl:variable name="percent-tests"> + <xsl:choose> + <xsl:when test="$total-tests > 0"> + <xsl:value-of select="round((($pass-tests div $total-tests) * 100) - 0.5)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="0"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <!-- Shaded Line --> <xsl:element name="hr"> -- Gitblit v1.10.0