~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-test/test-common.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2007-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "istream-private.h"
17
17
struct test_istream {
18
18
        struct istream_private istream;
19
19
        unsigned int skip_diff;
20
 
        size_t max_pos, max_buffer_size;
 
20
        size_t max_pos;
21
21
        bool allow_eof;
22
22
};
23
23
 
29
29
 
30
30
        i_assert(stream->skip <= stream->pos);
31
31
 
32
 
        if (stream->pos - stream->skip >= tstream->max_buffer_size)
 
32
        if (stream->pos - stream->skip >= tstream->istream.max_buffer_size)
33
33
                return -2;
34
34
 
35
35
        if (tstream->max_pos < stream->pos) {
85
85
 
86
86
        tstream->istream.istream.blocking = FALSE;
87
87
        tstream->istream.istream.seekable = TRUE;
88
 
        (void)i_stream_create(&tstream->istream, NULL, -1);
 
88
        i_stream_create(&tstream->istream, NULL, -1);
89
89
        tstream->istream.statbuf.st_size = tstream->max_pos = size;
90
90
        tstream->allow_eof = TRUE;
91
 
        tstream->max_buffer_size = (size_t)-1;
 
91
        tstream->istream.max_buffer_size = (size_t)-1;
92
92
        return &tstream->istream.istream;
93
93
}
94
94
 
110
110
        struct test_istream *tstream =
111
111
                (struct test_istream *)input->real_stream;
112
112
 
113
 
        tstream->max_buffer_size = size;
 
113
        tstream->istream.max_buffer_size = size;
114
114
}
115
115
 
116
116
void test_istream_set_size(struct istream *input, uoff_t size)