aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_disk.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/util/test_disk.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/util/test_disk.c')
-rw-r--r--src/util/test_disk.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index d8d8021e5..91154a6f5 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -37,8 +37,7 @@ testReadWrite ()
37 int ret; 37 int ret;
38 38
39 if (strlen (TESTSTRING) != 39 if (strlen (TESTSTRING) !=
40 GNUNET_DISK_fn_write (".testfile", TESTSTRING, 40 GNUNET_DISK_fn_write (".testfile", TESTSTRING, strlen (TESTSTRING),
41 strlen (TESTSTRING),
42 GNUNET_DISK_PERM_USER_READ | 41 GNUNET_DISK_PERM_USER_READ |
43 GNUNET_DISK_PERM_USER_WRITE)) 42 GNUNET_DISK_PERM_USER_WRITE))
44 return 1; 43 return 1;
@@ -53,9 +52,8 @@ testReadWrite ()
53 tmp[ret] = '\0'; 52 tmp[ret] = '\0';
54 if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1)) 53 if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
55 { 54 {
56 fprintf (stderr, 55 fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
57 "Error in testReadWrite: *%s* != *%s* for file %s\n", 56 TESTSTRING, ".testfile");
58 tmp, TESTSTRING, ".testfile");
59 return 1; 57 return 1;
60 } 58 }
61 GNUNET_DISK_file_copy (".testfile", ".testfile2"); 59 GNUNET_DISK_file_copy (".testfile", ".testfile2");
@@ -63,16 +61,15 @@ testReadWrite ()
63 ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1); 61 ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1);
64 if (ret < 0) 62 if (ret < 0)
65 { 63 {
66 fprintf (stderr, 64 fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
67 "Error reading file `%s' in testReadWrite\n", ".testfile2"); 65 ".testfile2");
68 return 1; 66 return 1;
69 } 67 }
70 tmp[ret] = '\0'; 68 tmp[ret] = '\0';
71 if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1)) 69 if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
72 { 70 {
73 fprintf (stderr, 71 fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
74 "Error in testReadWrite: *%s* != *%s* for file %s\n", 72 TESTSTRING, ".testfile2");
75 tmp, TESTSTRING, ".testfile2");
76 return 1; 73 return 1;
77 } 74 }
78 75
@@ -91,8 +88,9 @@ testOpenClose ()
91 uint64_t size; 88 uint64_t size;
92 long avail; 89 long avail;
93 90
94 fh = GNUNET_DISK_file_open (".testfile", GNUNET_DISK_OPEN_READWRITE 91 fh = GNUNET_DISK_file_open (".testfile",
95 | GNUNET_DISK_OPEN_CREATE, 92 GNUNET_DISK_OPEN_READWRITE |
93 GNUNET_DISK_OPEN_CREATE,
96 GNUNET_DISK_PERM_USER_READ | 94 GNUNET_DISK_PERM_USER_READ |
97 GNUNET_DISK_PERM_USER_WRITE); 95 GNUNET_DISK_PERM_USER_WRITE);
98 GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh)); 96 GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh));
@@ -108,8 +106,9 @@ testOpenClose ()
108 GNUNET_log_skip (1, GNUNET_NO); 106 GNUNET_log_skip (1, GNUNET_NO);
109 avail = GNUNET_DISK_get_blocks_available (".testfile"); 107 avail = GNUNET_DISK_get_blocks_available (".testfile");
110 GNUNET_log_skip (0, GNUNET_NO); 108 GNUNET_log_skip (0, GNUNET_NO);
111 fh = GNUNET_DISK_file_open (".testfile", GNUNET_DISK_OPEN_READWRITE 109 fh = GNUNET_DISK_file_open (".testfile",
112 | GNUNET_DISK_OPEN_CREATE, 110 GNUNET_DISK_OPEN_READWRITE |
111 GNUNET_DISK_OPEN_CREATE,
113 GNUNET_DISK_PERM_USER_WRITE | 112 GNUNET_DISK_PERM_USER_WRITE |
114 GNUNET_DISK_PERM_USER_READ); 113 GNUNET_DISK_PERM_USER_READ);
115 GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh)); 114 GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh));
@@ -156,8 +155,7 @@ testDirScan ()
156} 155}
157 156
158static void 157static void
159iter_callback (void *cls, 158iter_callback (void *cls, struct GNUNET_DISK_DirectoryIterator *di,
160 struct GNUNET_DISK_DirectoryIterator *di,
161 const char *filename, const char *dirname) 159 const char *filename, const char *dirname)
162{ 160{
163 int *i = cls; 161 int *i = cls;