diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-08-17 23:27:02 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-08-17 23:49:39 +0200 |
commit | d5c83f201441f2582dd074729d2ccdce90b1243e (patch) | |
tree | 7ba32ccadbfb2af6c79b6bf09b4f986ba614725a /src/test/test.c | |
parent | 5ffe105598135a92777d78cc82399fa281c52c5f (diff) | |
download | tor-d5c83f201441f2582dd074729d2ccdce90b1243e.tar.gz tor-d5c83f201441f2582dd074729d2ccdce90b1243e.zip |
Remove unused function declarations
Also remove some #if 0'd code from the unit tests for buffers. The
code was killed in e6794e58081af773073c266e23fe3ab2ebecdb7e (5 years
ago), and is now broken anyways.
Diffstat (limited to 'src/test/test.c')
-rw-r--r-- | src/test/test.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/test/test.c b/src/test/test.c index 4a34fd9ac4..16ac1e4a67 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -345,76 +345,6 @@ test_buffers(void) buf_free(buf); buf = NULL; -#if 0 - { - int s; - int eof; - int i; - buf_t *buf2; - /**** - * read_to_buf - ****/ - s = open(get_fname("data"), O_WRONLY|O_CREAT|O_TRUNC, 0600); - write(s, str, 256); - close(s); - - s = open(get_fname("data"), O_RDONLY, 0); - eof = 0; - errno = 0; /* XXXX */ - i = read_to_buf(s, 10, buf, &eof); - printf("%s\n", strerror(errno)); - test_eq(i, 10); - test_eq(eof, 0); - //test_eq(buf_capacity(buf), 4096); - test_eq(buf_datalen(buf), 10); - - test_memeq(str, (char*)_buf_peek_raw_buffer(buf), 10); - - /* Test reading 0 bytes. */ - i = read_to_buf(s, 0, buf, &eof); - //test_eq(buf_capacity(buf), 512*1024); - test_eq(buf_datalen(buf), 10); - test_eq(eof, 0); - test_eq(i, 0); - - /* Now test when buffer is filled exactly. */ - buf2 = buf_new_with_capacity(6); - i = read_to_buf(s, 6, buf2, &eof); - //test_eq(buf_capacity(buf2), 6); - test_eq(buf_datalen(buf2), 6); - test_eq(eof, 0); - test_eq(i, 6); - test_memeq(str+10, (char*)_buf_peek_raw_buffer(buf2), 6); - buf_free(buf2); - buf2 = NULL; - - /* Now test when buffer is filled with more data to read. */ - buf2 = buf_new_with_capacity(32); - i = read_to_buf(s, 128, buf2, &eof); - //test_eq(buf_capacity(buf2), 128); - test_eq(buf_datalen(buf2), 32); - test_eq(eof, 0); - test_eq(i, 32); - buf_free(buf2); - buf2 = NULL; - - /* Now read to eof. */ - test_assert(buf_capacity(buf) > 256); - i = read_to_buf(s, 1024, buf, &eof); - test_eq(i, (256-32-10-6)); - test_eq(buf_capacity(buf), MAX_BUF_SIZE); - test_eq(buf_datalen(buf), 256-6-32); - test_memeq(str, (char*)_buf_peek_raw_buffer(buf), 10); /* XXX Check rest. */ - test_eq(eof, 0); - - i = read_to_buf(s, 1024, buf, &eof); - test_eq(i, 0); - test_eq(buf_capacity(buf), MAX_BUF_SIZE); - test_eq(buf_datalen(buf), 256-6-32); - test_eq(eof, 1); - } -#endif - done: if (buf) buf_free(buf); |