2009-12-24 18:36:01 +00:00
|
|
|
#! /bin/bash
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2014-01-14 06:29:14 +00:00
|
|
|
run_test ./drive_line_buffer "${top_srcdir}/src/line_buffer.hh"
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
check_output "Line buffer output doesn't match input?" < \
|
2014-01-14 06:29:14 +00:00
|
|
|
"${top_srcdir}/src/line_buffer.hh"
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
run_test ./drive_line_buffer < ${top_srcdir}/src/line_buffer.hh
|
|
|
|
|
|
|
|
check_output "Line buffer output doesn't match input from pipe?" < \
|
2014-01-14 06:29:14 +00:00
|
|
|
"${top_srcdir}/src/line_buffer.hh"
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2014-01-14 06:29:14 +00:00
|
|
|
run_test ./drive_line_buffer -d " " "${top_srcdir}/src/line_buffer.hh"
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
check_output "Line buffer with delim output doesn't match input?" < \
|
2014-01-14 06:29:14 +00:00
|
|
|
"${top_srcdir}/src/line_buffer.hh"
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
cat > lb.dat <<EOF
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
EOF
|
|
|
|
|
|
|
|
LINE_OFF=`grep -b '4' lb.dat | cut -f 1 -d :`
|
|
|
|
|
|
|
|
run_test ./drive_line_buffer -o $LINE_OFF lb.dat
|
|
|
|
|
|
|
|
check_output "Seeking in the line buffer doesn't work?" <<EOF
|
|
|
|
4
|
|
|
|
5
|
|
|
|
EOF
|
|
|
|
|
2014-01-14 06:29:14 +00:00
|
|
|
cat "${top_srcdir}/src/"*.hh "${top_srcdir}/src/"*.cc > lb-2.dat
|
2009-09-14 01:07:32 +00:00
|
|
|
grep -b '$' lb-2.dat | cut -f 1 -d : > lb.index
|
|
|
|
line_count=`wc -l lb-2.dat`
|
|
|
|
|
|
|
|
run_test ./drive_line_buffer -i lb.index -n 100 lb-2.dat
|
|
|
|
|
|
|
|
check_output "Random reads don't match input?" <<EOF
|
|
|
|
All done
|
|
|
|
EOF
|