Commit 739d9357 authored by conrad's avatar conrad

initialization bugfixes to flushing test


git-svn-id: http://svn.annodex.net/liboggz/trunk@696 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 1a645874
......@@ -44,14 +44,17 @@
#define DATA_BUF_LEN 1024
static long serialno1, serialno2;
static int write_called = 0;
static int newpage = 0;
static int hungry_iter = 0;
static int hungry_e_o_s = 0;
static int read_iter = 0;
static int read_e_o_s = 0;
static int write_called = 0;
static int write_offset = 0;
static int
hungry (OGGZ * oggz, int empty, void * user_data)
......@@ -136,16 +139,15 @@ static size_t
my_io_write (void * user_handle, void * buf, size_t n)
{
unsigned char * data_buf = (unsigned char *)user_handle;
static int offset = 0;
int len;
/* Mark that the write IO method was actually used */
write_called++;
len = MIN (n, DATA_BUF_LEN - offset);
memcpy (&data_buf[offset], buf, len);
len = MIN (n, DATA_BUF_LEN - write_offset);
memcpy (&data_buf[write_offset], buf, len);
offset += len;
write_offset += len;
return len;
}
......@@ -157,12 +159,17 @@ test_flushing (int flush, char * filename)
unsigned char data_buf[DATA_BUF_LEN];
long n;
newpage = 0;
hungry_iter = 0;
hungry_e_o_s = 0;
read_iter = 0;
read_e_o_s = 0;
write_called = 0;
write_offset = 0;
writer = oggz_new (OGGZ_WRITE);
if (writer == NULL)
FAIL("newly created OGGZ writer == NULL");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment