Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1608

Create OutputValueCalc torture tests.

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.0.0
    • 2.0.0
    • Unparsing
    • None

      From Mike's e-mail:

      We need to improve test coverage on dfdl:outputValueCalc.

      Here are a few ideas for "torture tests".

      I would work on these, but I still have a final unparser feature to code, and a bunch of review-related changes to do.

        • create runtime-valued property and dfdl:outputValueCalc torture tests

      These tests are based around:

      <element name="xi" type="xs:string" dfdl:length="1" dfdl:lengthKind="explicit"/>
      <element name="yi" type="xs:string dfdl:length="1" dfdl:lengthKind="explicit""/>
      <element name="zi" type="xs:string" dfdl:length="1" dfdl:lengthKind="explicit"/>

      <element name="x" type="xs:string" dfdl:outputValueCalc="

      { dfdl:valueLength(../y) }

      " dfdl:initiator="

      { ../xi }

      " dfdl:lengthKind="delimited" dfdl:terminator=";"/>
      <element name="y" type="xs:string" dfdl:outputValueCalc="

      { dfdl:valueLength(../z}

      )" dfdl:initiator="

      { ../yi }

      " dfdl:lengthKind="delimited" dfdl:terminator=";"/>
      <element name="z" type="xs:string" dfdl:initiator="

      { ../zi }

      " dfdl:lengthKind="delimited" dfdl:terminator=";"/>

      The dfdl:outputValueCalc's in the above require the unparser to suspend unparsing of x and y, then unparse them first z, then y, then x, but put their output in x,y, z order.

      The test is to make sure this happens correctly even if each of x, y, z gets a runtime-valued property's values are all different. E.g.,
      <xi>X</xi>
      <yi>Y</yi>
      <zi>Z</zi>
      <z> 0123456789</z>

      unparsing shoudl produce

      XYZX2;Y10;Z0123456789;

      Generalize this idea to all the other runtime-valued properties beyond just initiator.

      byteOrder
      encoding
      outputNewLine
      initiator
      terminator
      separator
      escapeCharacter
      escapeEscapeCharacter
      textStandardDecimalSeparator
      textStandardGroupingSeparator
      textStandardExponentRep
      calendarLanguage

        • create test that dfdl:outputValueCalc freezes the delimiter stacks

      similar concept to the above, except the delimiters come from surrounding nests of sequences.

      When each unparses (which should be y first then x), it should get the right delimiters. This insures we're freezing the delimiter stack, and the values of the delimiters on them.

        • create test that dfdl:occursIndex freezes properly for OVC

      similar concept to the above, but the OVC expressions depend on freezing of different dfdl:occursIndex values. (Two arrays of the same length, contain complex types. Inside those are OVC elements....)

              efinnegan Elizabeth Finnegan
              twise Taylor Wise
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: