File: test-mapeof.sh

package info (click to toggle)
libhsync 0.5.7-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,060 kB
  • ctags: 543
  • sloc: sh: 7,944; ansic: 5,413; makefile: 154
file content (25 lines) | stat: -rwxr-xr-x 594 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh -pe

# libhsync test case.

# Copyright (C) 2000 by Martin Pool
# $Id: test-mapeof.sh,v 1.5 2000/08/27 08:58:55 mbp Exp $

# Test that inbufs do the right thing near EOF.

from=$tmpdir/basis
new=$tmpdir/new.tmp
cmds=$tmpdir/cmds

run_test date >$from

# In this case we make the input be a pipe, which is a reasonable
# imitation of a socketpair.  This makes sure that map_ptr works OK on
# a file on which we can neither seek nor determine the real size.
for ioargs in '' '-k' '-n -s -k'
do
    cat $from | run_test hsmapread $ioargs 0,1000 >$new
    run_test cmp $from $new
done