tests: Improve test coverage

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1074 99668b35-9821-0410-8761-19e4c4f06640
tests: Add more tests for better coverage

More tests for out-of-memory and other edge conditions

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1075 99668b35-9821-0410-8761-19e4c4f06640
tests: Add even more coverage tests

Also fix MSVC6 compilation (make convertions to function pointers explicit).

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1076 99668b35-9821-0410-8761-19e4c4f06640
tests: Fix test failure in PUGIXML_WCHAR_MODE

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1077 99668b35-9821-0410-8761-19e4c4f06640
Remove redundant null pointer checks.

When removing a node or attribute, we know that the parent has at least one
node/attribute so a null pointer check is redundant.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1078 99668b35-9821-0410-8761-19e4c4f06640
Add 'coverage' configuration to Makefile.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1079 99668b35-9821-0410-8761-19e4c4f06640
Fix node copying for some out of memory cases

A page can fail to allocate during attribute creation; this case was not
previously handled.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1080 99668b35-9821-0410-8761-19e4c4f06640
tests: Add a way for tests to verify allocation failure

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1081 99668b35-9821-0410-8761-19e4c4f06640
Update README.md with new documentation URLs.
tests: Remove git2svn helper script!
XPath: Optimize constant filters/predicates

If a filter/predicate expression is a constant, we don't need to evaluate it
for every nodeset element - we can evaluate it once and pick the right element
or keep/discard the entire collection.

If the expression is 1, we can early out on first node when evaluating the
node set - queries like following::item[1] are now significantly faster.

Additionally this change refactors filters/predicates to have additional
metadata describing the expression type in _test field that is filled during
optimization.

Note that predicate_constant selection right now is very simple (but captures
most common use cases except for maybe [last()]).
XPath: Unify ast_filter/ast_predicate structure

Now expression is always _right for filter/predicate nodes to make optimize()
simpler. Additionally we now use predicate metadata to make is_posinv_step()
faster.

This introduces a weak ordering dependency in rewrite rules to optimize() -
classification has to be performed before other optimizations.
XPath: Only recognize numeric constant expressions

Numeric and boolean constant expressions in filters are different in that
to evaluate numeric expressions we need a sorted order, but to evaluate
boolean expressions we don't. The previously implemented optimization adds
an extra sorting step for constant boolean filters that will be more expensive
than redundant computations.

Since constant booleans are sort of an edge case, don't do this optimization.
This allows us to simplify apply_predicate_const to only handle numbers.
XPath: Optimize [position()=expr] and [last()]

To get more benefits from constant predicate/filter optimization we rewrite
[position()=expr] predicates into [expr] for numeric expressions. Right now
the rewrite is only for entire expressions - it may be beneficial to split
complex expressions like [position()=constant and expr] into [constant][expr]
but that is more complicated.

last() does not depend on the node set contents so is "constant" as far as
our optimization is concerned so we can evaluate it once.
Optimize node printing by using raw pointers

This lets us do fewer null pointer checks (making printing 2% faster with -O3)
and removes a lot of function calls (making printing 20% faster with -O0).
Merge branch 'master' into compact
Fix compilation after merge.