Blob Blame History Raw
/* $XConsortium: StringNext.dat /main/4 1995/07/17 10:25:13 drk $ */
/*
 * Motif
 *
 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
 *
 * These libraries and programs are free software; you can
 * redistribute them and/or modify them under the terms of the GNU
 * Lesser General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * These libraries and programs are distributed in the hope that
 * they will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with these librararies and programs; if not, write
 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 * Floor, Boston, MA 02110-1301 USA
 * 
 */
/*
 * HISTORY
 */

@) This test checks that the XmString functions which parse a given
   XmString, return the components or segments of the XmString in
   the expected order along with the expected values.

#) An XmString is created by concatenating a number of XmString components.
   The functions, XmStringPeekNextTriple() and XmStringGetNextTriple()
   are called to retrieve each of the components from the XmString.
   Messages should be printed to stdout listing the XmStringComponentType
   returned and whether the comparison test between the values expected and
   the actual values returned by the function passed or failed. 
   Verify that all the comparison tests passed.
   

C)

#) The same XmString is parsed again. This time, the functions
   XmStringPeekNextComponent() and XmStringGetNextComponent() are
   called to return the next component type. Messages should be printed
   to stdout listing the XmStringComponentType returned and whether
   the comparison test between the values expected and the actual
   values returned by the function passed or failed.  Verify that all the comparison
   tests passed.

C)

#) An XmString is created by concatenating a number of XmString segments.
   The function XmStringGetNextSegment() is then called to retrieve
   each of the segments.  Messages should be printed to stdout indicating
   whether the comparison between the segment information expected and
   the actual segment information returned by the function passed or failed.  Verify that
   all the comparison tests passed.

C)

#) An XmString is created with the following XmString components and their values,
   where appropriate, listed in parentheses.
!)
   XmSTRING_COMPONENT_LAYOUT_PUSH     ( XmLEFT_TO_RIGHT )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" )
   XmSTRING_COMPONENT_TAG             ( XmSTRING_ISO8859-1 )
   XmSTRING_COMPONENT_TAB          
   XmSTRING_COMPONENT_DIRECTION       ( XmSTRING_DIRECTION_L_TO_R )
   XmSTRING_COMPONENT_TEXT            ( "Hello World" )
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag2" )
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag1" )
   XmSTRING_COMPONENT_LAYOUT_POP 
   XmSTRING_COMPONENT_SEPARATOR

#) The text "Hello World" should be rendered with the following attributes:
!) 
   Foreground Color:  red
   Font:              9x15
   Tab:               1 inch ( from the left margin ) 

#) The XmString component types will be printed to stdout in the order
   in which they have been retreived from the XmString.
   Verify that the component types returned conform to the following 
   order:

!)     [
        [ XmSTRING_COMPONENT_LAYOUT_PUSH ]
        [ XmSTRING_COMPONENT_RENDITION_BEGIN ]*
        [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ]
        [ XmSTRING_COMPONENT_TAB ]*
        [ XmSTRING_COMPONENT_DIRECTION ]
        [ XmSTRING_COMPONENT_TEXT |
          XmSTRING_COMPONENT_LOCALE_TEXT |
          XmSTRING_COMPONENT_WIDECHAR_TEXT ]
        [ XmSTRING_COMPONENT_RENDITION_END ]*
        [ XmSTRING_COMPONENT_LAYOUT_POP ]
        [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END
C)

#) An XmString is created with the following XmString components and their values,
   where appropriate, listed in parentheses.
!)
   XmSTRING_COMPONENT_LAYOUT_PUSH     ( XmLEFT_TO_RIGHT )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" )
   XmSTRING_COMPONENT_TAB
   XmSTRING_COMPONENT_DIRECTION       ( XmSTRING_DIRECTION_R_TO_L )
   XmSTRING_COMPONENT_LOCALE_TEXT     ( "Hello World" )
   XmSTRING_COMPONENT_DIRECTION       ( XmSTRING_DIRECTION_L_TO_R )
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag2" )
   XmSTRING_COMPONENT_LAYOUT_POP
   XmSTRING_COMPONENT_SEPARATOR
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag1" )

#) The text "dlroW olleH" should be rendered with the following attributes:

!) 
   Foreground Color:  black
   Font:              fixed
   Tab:               1.0 inch ( from the left margin )

#) The XmString component types will be printed to stdout in the order
   in which they have been retreived from the XmString.
   Verify that the component types returned conform to the following 
   order:

!)     [
         [ XmSTRING_COMPONENT_LAYOUT_PUSH ]
         [ XmSTRING_COMPONENT_RENDITION_BEGIN ]*
         [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ]
         [ XmSTRING_COMPONENT_TAB ]*
         [ XmSTRING_COMPONENT_DIRECTION ]
         [ XmSTRING_COMPONENT_TEXT |
           XmSTRING_COMPONENT_LOCALE_TEXT |
           XmSTRING_COMPONENT_WIDECHAR_TEXT ]
         [ XmSTRING_COMPONENT_RENDITION_END ]*
         [ XmSTRING_COMPONENT_LAYOUT_POP ]
         [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END

C)

#) An XmString is created with the following XmString components and their values,
   where appropriate, listed in parentheses.
!)
   XmSTRING_COMPONENT_LAYOUT_PUSH     ( XmRIGHT_TO_LEFT )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag2" )
   XmSTRING_COMPONENT_DIRECTION       ( XmSTRING_DIRECTION_R_TO_L )
   XmSTRING_COMPONENT_WIDECHAR_TEXT   ( "Hi " )
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag2" )
   XmSTRING_COMPONENT_RENDITION_BEGIN ( "render_tag1" )
   XmSTRING_COMPONENT_TAB               
   XmSTRING_COMPONENT_DIRECTION       ( XmSTRING_DIRECTION_L_TO_R )
   XmSTRING_COMPONENT_TEXT            ( "World" )
   XmSTRING_COMPONENT_RENDITION_END   ( "render_tag1" )
   XmSTRING_COMPONENT_LAYOUT_POP


#) The text " World  iH" should be rendered with the following attributes:

!) 
"World"
   Foreground Color:  black
   Font:              fixed
   Tab:               1 inch ( from the right side of the word "iH" ) 

!) 
"iH"
   Foreground Color:  red
   Font:              9x15
   Tab:               None 

#) The XmString component types will be printed to stdout in the order
   in which they have been retreived from the XmString.
   Verify that the component types returned conform to the following 
   order:

!)     [
         [ XmSTRING_COMPONENT_LAYOUT_PUSH ]
         [ XmSTRING_COMPONENT_RENDITION_BEGIN ]*
         [ XmSTRING_COMPONENT_TAG | XmSTRING_COMPONENT_LOCALE ]
         [ XmSTRING_COMPONENT_TAB ]*
         [ XmSTRING_COMPONENT_DIRECTION ]
         [ XmSTRING_COMPONENT_TEXT |
           XmSTRING_COMPONENT_LOCALE_TEXT |
           XmSTRING_COMPONENT_WIDECHAR_TEXT ]
         [ XmSTRING_COMPONENT_RENDITION_END ]*
         [ XmSTRING_COMPONENT_LAYOUT_POP ]
         [ XmSTRING_COMPONENT_SEPARATOR ] ]* XmSTRING_COMPONENT_END

C)
E)