[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    tests/kofficetests/interoperability/kword
From:       Shaheed Haque <srhaque () theiet ! org>
Date:       2010-03-31 22:31:02
Message-ID: 20100331223102.3233CAC888 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1109735 by shaheed:

Tidy-up some test cases using latest sharedtemplates

 M  +12 -11    MSWord2000/mw00_normal_text.xsl  
 M  +24 -32    MSWord2000/mw00_text_alignment.xsl  
 M  +18 -24    MSWord2003/mw03_alignment_text.xsl  
 M  +12 -11    MSWord2003/mw03_normal_text.xsl  


--- trunk/tests/kofficetests/interoperability/kword/MSWord2000/mw00_normal_text.xsl \
#1109734:1109735 @@ -10,17 +10,18 @@
 <x:include href="sharedtemplates.xsl"/>
 
 <x:template match="/o:document-content">
-  <x:if test="count(o:body/o:text/t:p[@t:style-name='P1']) != 1">
-    <x:message terminate="yes">
-mw00_normal_text-error: there are <x:value-of \
                select="count(o:body/o:text/t:p[@t:style-name='P1'])"/> P1 \
                paragraphs, should be 1.
-    </x:message>
-  </x:if>
-  <x:if test="count(o:body/o:text/t:p[@t:style-name='P2']) != 4">
-    <x:message terminate="yes">
-mw00_normal_text-error: there are <x:value-of \
                select="count(o:body/o:text/t:p[@t:style-name='P2'])"/> P2 \
                paragraphs, should be 4.
-    </x:message>
-  </x:if>
-
+  <x:call-template name="checkForItemCount">
+    <x:with-param name="testId" select="'mw00_normal_text.p1_paragraphs'"/>
+    <x:with-param name="itemDescription" select="'p1_paragraphs'"/>
+    <x:with-param name="itemSelector" \
select="o:body/o:text/t:p[@t:style-name='P1']"/> +    <x:with-param name="count" \
select="1"/> +  </x:call-template>
+  <x:call-template name="checkForItemCount">
+    <x:with-param name="testId" select="'mw00_normal_text.p2_paragraphs'"/>
+    <x:with-param name="itemDescription" select="'p1_paragraphs'"/>
+    <x:with-param name="itemSelector" \
select="o:body/o:text/t:p[@t:style-name='P2']"/> +    <x:with-param name="count" \
select="4"/> +  </x:call-template>
 </x:template>
 
 </x:stylesheet>
--- trunk/tests/kofficetests/interoperability/kword/MSWord2000/mw00_text_alignment.xsl \
#1109734:1109735 @@ -10,41 +10,33 @@
 <x:include href="sharedtemplates.xsl"/>
 
 <x:template match="/o:document-content">
-  <x:variable name="testCenterAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw00_text_alignment.testCenterAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p[position()=1]"/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'center'"/>
-    </x:call-template>
-  </x:variable>
-  <x:variable name="testJustifyAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw00_text_alignment.testJustifyAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p[position()=13]"/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'justify'"/>
-    </x:call-template>
-  </x:variable>
-  <x:variable name="testRightAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw00_text_alignment.testRightAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p[position()=8]"/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'end'"/>
-    </x:call-template>
-  </x:variable>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw00_text_alignment.testCenterAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p[position()=1]"/> +    <x:with-param \
name="attributeName" select="'text-align'"/> +    <x:with-param name="value" \
select="'center'"/> +  </x:call-template>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw00_text_alignment.testJustifyAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p[position()=13]"/> +    <x:with-param \
name="attributeName" select="'text-align'"/> +    <x:with-param name="value" \
select="'justify'"/> +  </x:call-template>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw00_text_alignment.testRightAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p[position()=8]"/> +    <x:with-param \
name="attributeName" select="'text-align'"/> +    <x:with-param name="value" \
select="'end'"/> +  </x:call-template>
   <!-- This test presently fails, even though kword and oowriter display it
        correctly left-aligned. I presume this is something to do with derived
        styles, but am not going to worry about it for now. -->
-  <x:variable name="testLeftAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw00_text_alignment.testLeftAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p[position()=5]"/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'start'"/>
-    </x:call-template>
-  </x:variable>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw00_text_alignment.testLeftAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p[position()=5]"/> +    <x:with-param \
name="attributeName" select="'text-align'"/> +    <x:with-param name="value" \
select="'start'"/> +  </x:call-template>
 </x:template>
 
 </x:stylesheet>
--- trunk/tests/kofficetests/interoperability/kword/MSWord2003/mw03_alignment_text.xsl \
#1109734:1109735 @@ -10,30 +10,24 @@
 <x:include href="sharedtemplates.xsl"/>
 
 <x:template match="/o:document-content">
-  <x:variable name="testLeftAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw03_alignment_text.testLeftAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p/t:span[text()='ALIGN \
                LEFT']/.."/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'start'"/>
-    </x:call-template>
-  </x:variable>
-  <x:variable name="testCenterAlignedParagraph">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw03_alignment_text.testCenterAlignedParagraph'"/>
-      <x:with-param name="element" select="o:body/o:text/t:p/t:span[text()='ALIGN \
                CENTER']/.."/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'center'"/>
-    </x:call-template>
-  </x:variable>
-  <x:variable name="testRightAlignedText">
-    <x:call-template name="checkForStyleAttributeMatch">
-      <x:with-param name="testId" \
                select="'mw03_alignment_text.testRightAlignedText'"/>
-      <x:with-param name="element" \
                select="o:body/o:text/t:p/t:span[starts-with(text(),'This is align \
                right')]/.."/>
-      <x:with-param name="attributeName" select="'text-align'"/>
-      <x:with-param name="value" select="'end'"/>
-    </x:call-template>
-  </x:variable>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw03_alignment_text.testLeftAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p/t:span[text()='ALIGN LEFT']/.."/> +    \
<x:with-param name="attributeName" select="'text-align'"/> +    <x:with-param \
name="value" select="'start'"/> +  </x:call-template>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw03_alignment_text.testCenterAlignedParagraph'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p/t:span[text()='ALIGN CENTER']/.."/> +    \
<x:with-param name="attributeName" select="'text-align'"/> +    <x:with-param \
name="value" select="'center'"/> +  </x:call-template>
+  <x:call-template name="checkForStyleAttributeMatch">
+    <x:with-param name="testId" \
select="'mw03_alignment_text.testRightAlignedText'"/> +    <x:with-param \
name="element" select="o:body/o:text/t:p/t:span[starts-with(text(),'This is align \
right')]/.."/> +    <x:with-param name="attributeName" select="'text-align'"/>
+    <x:with-param name="value" select="'end'"/>
+  </x:call-template>
 </x:template>
 
 </x:stylesheet>
--- trunk/tests/kofficetests/interoperability/kword/MSWord2003/mw03_normal_text.xsl \
#1109734:1109735 @@ -10,17 +10,18 @@
 <x:include href="sharedtemplates.xsl"/>
 
 <x:template match="/o:document-content">
-  <x:if test="count(o:body/o:text/t:p[@t:style-name='P1']) != 1">
-    <x:message terminate="yes">
-mw03_normal_text-error: there are <x:value-of \
                select="count(o:body/o:text/t:p[@t:style-name='P1'])"/> P1 \
                paragraphs, should be 1.
-    </x:message>
-  </x:if>
-  <x:if test="count(o:body/o:text/t:p[@t:style-name='P2']) != 7">
-    <x:message terminate="yes">
-mw03_normal_text-error: there are <x:value-of \
                select="count(o:body/o:text/t:p[@t:style-name='P2'])"/> P2 \
                paragraphs, should be 7.
-    </x:message>
-  </x:if>
-
+  <x:call-template name="checkForItemCount">
+    <x:with-param name="testId" select="'mw03_normal_text.p1_paragraphs'"/>
+    <x:with-param name="itemDescription" select="'p1_paragraphs'"/>
+    <x:with-param name="itemSelector" \
select="o:body/o:text/t:p[@t:style-name='P1']"/> +    <x:with-param name="count" \
select="1"/> +  </x:call-template>
+  <x:call-template name="checkForItemCount">
+    <x:with-param name="testId" select="'mw03_normal_text.p2_paragraphs'"/>
+    <x:with-param name="itemDescription" select="'p1_paragraphs'"/>
+    <x:with-param name="itemSelector" \
select="o:body/o:text/t:p[@t:style-name='P2']"/> +    <x:with-param name="count" \
select="7"/> +  </x:call-template>
 </x:template>
 
 </x:stylesheet>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic