#
# Swiss Map (.xol) tests
#
gpsbabel -i xol -f ${REFERENCE}/xol-sample.xol -o gpx -F ${TMPDIR}/xol-sample.gpx
compare ${REFERENCE}/xol-sample.gpx ${TMPDIR}/xol-sample.gpx 

# check xmlgeneric can handle stdin
rm -f ${TMPDIR}/xol-sample.gpx
cat ${REFERENCE}/xol-sample.xol | gpsbabel -i xol -f - -o gpx -F ${TMPDIR}/xol-sample.gpx
compare ${REFERENCE}/xol-sample.gpx ${TMPDIR}/xol-sample.gpx 

# check xmlgeneric can detect no input file
# we expect this to fail
rm -f ${TMPDIR}/xol-sample_si.gpx
${VALGRIND} "${PNAME}" -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.gpx 2> ${TMPDIR}/nonexistent.err && {
         echo "${PNAME} succeeded! (it shouldn't have with this input...)"
}
# check error message is what we expected.
# The message can vary depending on the c runtime, .i.e. msvc and gcc are slightly different.
compare_with_alternate ${REFERENCE}/nonexistent.err ${REFERENCE}/nonexistent_alternate.err ${TMPDIR}/nonexistent.err


gpsbabel -i gpx -f ${REFERENCE}/xol-sample.gpx -o xol -F ${TMPDIR}/xol-sample-gpx.xol
compare ${REFERENCE}/xol-sample-gpx.xol ${TMPDIR}/xol-sample-gpx.xol 

