This is src/test/pmreorder_stack/README.

This directory contains a unit test for pmreorder script.

SYNOPSIS:
pmreorder_stack w|c file

DESCRIPTION:
pmreorder_stack is the unit test for verifying the functionality of
pmreorder stack.

OPTIONS:
	file is '$DIR/testfile'
	w: write data to the pool in an inconsistent way
	c: check pool consistency

The pool contains 12 int fields. Pool is consistent only if
field 'e' is equal to 1 and field 'f' is equal to 0. To test
pmreorder stack with this consistency checker we are using 3
types of engines: NoReorderNoCheck, ReorderReverseAccumulative,
ReorderAccumulative and set 3 barriers, after each 4 fields.
Here's the stack flow:

push(NoReorderNoCheck) # the default one
push(ReorderAccumulative) # set by macro
push(ReorderRevertAccumulative) # set by macro

[
check:  d,
	d, c
	d, c, b
	d, c, b, a
result: ALL INCONSISTENT
]

pop(ReorderReverseAccumulative) # engine should back to previous one
[
check:  e, # e=1 and f=0
	e, f
	e, f, g
	e, f, g, h
result: ONE CONSISTENT # if pop did not work all would be inconsistent
]
pop(ReorderAccumulative) # back to default engine

# nothing more should be logged as inconsistent because we are skipping
# consistency checker for last barrier (NoReorderNoCheck engine from the stack)
