diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-19 22:28:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-19 22:28:37 +0000 |
commit | 09cfcd83bd680bd5178c7fead1c6927fcf45b352 (patch) | |
tree | 2e96207c413407d1a487035c9136807b1ffa5b37 /src/util/test_bio.c | |
parent | 8da07c23a94221fea5d73ebac9a522f72e3adef3 (diff) | |
download | gnunet-09cfcd83bd680bd5178c7fead1c6927fcf45b352.tar.gz gnunet-09cfcd83bd680bd5178c7fead1c6927fcf45b352.zip |
fixing bio bugs
Diffstat (limited to 'src/util/test_bio.c')
-rw-r--r-- | src/util/test_bio.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/util/test_bio.c b/src/util/test_bio.c index 47992f56e..fa8fa0e2f 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c | |||
@@ -34,10 +34,9 @@ int | |||
34 | main (int argc, char *argv[]) | 34 | main (int argc, char *argv[]) |
35 | { | 35 | { |
36 | 36 | ||
37 | char *readResultString; | 37 | char *readResultString; |
38 | int64_t testNumber = (int64_t)TESTNUMBER64; | 38 | int64_t testNumber = (int64_t)TESTNUMBER64; |
39 | 39 | int64_t testNum; | |
40 | const char *writeString = TESTSTRING; | ||
41 | char *msg; | 40 | char *msg; |
42 | 41 | ||
43 | char* fileName = GNUNET_DISK_mktemp ("gnunet_bio"); | 42 | char* fileName = GNUNET_DISK_mktemp ("gnunet_bio"); |
@@ -49,16 +48,15 @@ main (int argc, char *argv[]) | |||
49 | metaDataW = GNUNET_CONTAINER_meta_data_create(); | 48 | metaDataW = GNUNET_CONTAINER_meta_data_create(); |
50 | GNUNET_CONTAINER_meta_data_add_publication_date(metaDataW); | 49 | GNUNET_CONTAINER_meta_data_add_publication_date(metaDataW); |
51 | fileW = GNUNET_BIO_write_open(fileName); | 50 | fileW = GNUNET_BIO_write_open(fileName); |
52 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_string(fileW,writeString)); | 51 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_string(fileW, TESTSTRING)); |
53 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_meta_data(fileW,metaDataW)); | 52 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_meta_data(fileW,metaDataW)); |
54 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_int64(fileW,testNumber)); | 53 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_int64(fileW,testNumber)); |
55 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_close(fileW)); | 54 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_write_close(fileW)); |
56 | fileR = GNUNET_BIO_read_open (fileName); | 55 | fileR = GNUNET_BIO_read_open (fileName); |
57 | GNUNET_BIO_read_meta_data(fileR,"Read meta error",&metaDataR); | 56 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_read_string(fileR, "Read string error", &readResultString, 200)); |
58 | size_t readMaxLen = 200; | 57 | GNUNET_BIO_read_meta_data(fileR, "Read meta error", &metaDataR); |
59 | //GNUNET_assert(GNUNET_OK == GNUNET_BIO_read_string(fileR,"Read string error",&readResultString,readMaxLen)); | 58 | GNUNET_assert(GNUNET_OK == GNUNET_BIO_read_int64(fileR, &testNum)); |
60 | //GNUNET_assert(GNUNET_OK == GNUNET_BIO_read_int64__(fileR,"Read int64 error",&testNum)); | 59 | GNUNET_BIO_read_close(fileR,&msg); |
61 | GNUNET_BIO_read_close(fileR,&msg); | ||
62 | GNUNET_CONTAINER_meta_data_destroy(metaDataW); | 60 | GNUNET_CONTAINER_meta_data_destroy(metaDataW); |
63 | GNUNET_CONTAINER_meta_data_destroy(metaDataR); | 61 | GNUNET_CONTAINER_meta_data_destroy(metaDataR); |
64 | free(fileName); | 62 | free(fileName); |