API : iterator get and set position
authorJulien Desfossez <julien.desfossez@efficios.com>
Fri, 10 Feb 2012 02:32:52 +0000 (21:32 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 10 Feb 2012 02:32:52 +0000 (21:32 -0500)
This patch implements the save and restore position on a iterator.

Passed successfully these tests :
- test 1:
save the position
read n events (tested with multiple values of n)
restore
compare the outputs

- test 2:
in loop until the end of the trace :
        save the position
        read 5 events
        restore the position
        read 5 events
compare each block of 5 events

- test 3:
save the position before printing the first event
parse the trace entirely
restore to the beginning
parse the trace entirely
compare the 2 outputs

- test 4:
seek in the future (manually tweaked the values to restore to)
compare with a normal trace starting from the restore point

[ edit: use g_new/g_new0/g_free instead of malloc/calloc/free.
  Use g_new0 anytime a structure is not explicitly initialized by
  a helper, so if it grows in the future with new fields, they will be
  zeroed. ]

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

No differences found
This page took 0.026065 seconds and 4 git commands to generate.