<?xml version="1.0" encoding="utf-8"?>
<Peach xmlns="http://phed.org/2008/Peach" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://phed.org/2008/Peach ../peach.xsd" version="1.0"
	author="saintpatrick@l1pht.com">

  <!-- Import defaults for Peach instance -->
  <Include ns="default" src="file:defaults.xml" />

  <!-- COMM Chunk * Required -->
  <DataModel name="commchnk">
    <String name="commchnkid" value="COMM" length="4"/>
    <Number name="commchnksize" size="32" endian="big">
      <Relation type="size" of="commdata"/>
    </Number>
    <Block name="commdata">
      <Number name="commchannels" size="8" />
      <Number name="commsampleframes" size="32" />
      <Number name="commsamplesize" size="8" />
      <Blob name="commsamplerate"  length="12"/>
    </Block>
  </DataModel>

  <DataModel name="ssndchnk" >
    <String name="ssndchnkid" value="SSND" length="4" />
    <Number name="ssndchnksize" size="32" endian="big">
      <Relation type="size" of="ssnddata"/>
    </Number>
    <Block name="ssnddata">
      <Number name="ssndoffset" size="32" value="0" signed="false" endian="big"/>
      <Number name="ssndblocksize" size="32" value="0" signed="false" endian="big"/>
      <Blob name="ssndsounddata"/>
    </Block>
  </DataModel>

  <!-- Who is using this anyway? -->
  <DataModel name="FileData">
    <Block name="major" maxOccurs="100">
      <String name="chnkid" value="FORM" type="char" length="4" isStatic="true"/>
      <Number name="chnksize" size="32" endian="big" signed="false"/>
      <String name="formType" value="AIFF" length="4" isStatic="true"/>
      <Block ref="commchnk"/>
      <Block ref="ssndchnk"/>
      <Blob/>
    </Block>
  </DataModel>



  <!-- Define a simple state machine that will write the file and 
		then launch a program using the FileWriterLauncher publisher -->
  <StateModel name="State" initialState="Initial">
    <State name="Initial">
      <Action type="open" />

      <!-- Write out contents of file -->
      <Action name="WriteFile" type="output">
        <DataModel ref="FileData" />
        <Data name="data" fileName="C:\Peach2.3\aiff\loop1.aif"/>
      </Action>

      <!-- Close file -->
      <Action type="close" />

      <!-- Launch the file consumer -->
      <Action type="call" method="humancentipede.exe"/>
    </State>
  </StateModel>

  <!-- Setup a local agent that will monitor for faults -->
  <Agent name="LocalAgent">
    <Monitor class="debugger.WindowsDebugEngine">

      <!-- The command line to run.  Notice the filename provided matched up 
				to what is provided below in the Publisher configuration -->
      <Param name="CommandLine" value="C:\humancentipede.exe fuzzedfile.aiff" />

      <!-- This parameter will cause the debugger to wait for an action-call in
				the state model with a method="notepad.exe" before running
				program.  -->
      <Param name="StartOnCall" value="humancentipede.exe" />

    </Monitor>

    <!-- Enable heap debugging on our process as well. -->
    <Monitor class="process.PageHeap">
      <Param name="Executable" value="humancentipede.exe"/>
    </Monitor>
  </Agent>

  <Test name="TheTest">
    <Agent ref="LocalAgent" />

    <StateModel ref="State"/>

    <!-- Configure our publisher with correct filename to write too -->
    <Publisher class="file.FileWriterLauncherGui">
      <Param name="fileName" value="fuzzedfile.aiff" />
      <Param name="windowName" value="humancentipede media player" />
      <Param name="debugger" value="true"/>
    </Publisher>


    <!--Publisher class="file.FilePerIteration">
      <Param name="fileName" value="aiff\FileFuzzOut-%d.aiff"/>
    </Publisher-->

  </Test>

  <Run name="DefaultRun">
    <Test ref="TheTest" />
    <Logger class="logger.Filesystem">
      <Param name="path" value="c:\peach\logtest" />
    </Logger>
  </Run>

</Peach>
<!-- end -->

