From d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb Mon Sep 17 00:00:00 2001 From: ng0 Date: Sun, 8 Sep 2019 12:33:09 +0000 Subject: uncrustify as demanded. --- src/peerstore/test_peerstore_api_sync.c | 96 ++++++++++++++++----------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/peerstore/test_peerstore_api_sync.c') diff --git a/src/peerstore/test_peerstore_api_sync.c b/src/peerstore/test_peerstore_api_sync.c index 6fe12335e..7df4778be 100644 --- a/src/peerstore/test_peerstore_api_sync.c +++ b/src/peerstore/test_peerstore_api_sync.c @@ -11,12 +11,12 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . SPDX-License-Identifier: AGPL3.0-or-later -*/ + */ /** * @file peerstore/test_peerstore_api_sync.c * @brief testcase for peerstore sync-on-disconnect feature. Stores @@ -80,22 +80,22 @@ static const char *val = "test_peerstore_api_store_val"; * @return #GNUNET_YES (all good, continue) */ static void -iterate_cb (void *cls, - const struct GNUNET_PEERSTORE_Record *record, - const char *emsg) +iterate_cb(void *cls, + const struct GNUNET_PEERSTORE_Record *record, + const char *emsg) { const char *rec_val; - GNUNET_break (NULL == emsg); + GNUNET_break(NULL == emsg); if (NULL == record) - { - GNUNET_PEERSTORE_disconnect (h, - GNUNET_NO); - GNUNET_SCHEDULER_shutdown (); - return; - } + { + GNUNET_PEERSTORE_disconnect(h, + GNUNET_NO); + GNUNET_SCHEDULER_shutdown(); + return; + } rec_val = record->value; - GNUNET_break (0 == strcmp (rec_val, val)); + GNUNET_break(0 == strcmp(rec_val, val)); ok = 0; } @@ -107,14 +107,14 @@ iterate_cb (void *cls, * @param cls NULL */ static void -test_cont (void *cls) +test_cont(void *cls) { - h = GNUNET_PEERSTORE_connect (cfg); - GNUNET_PEERSTORE_iterate (h, - subsystem, - &pid, key, - &iterate_cb, - NULL); + h = GNUNET_PEERSTORE_connect(cfg); + GNUNET_PEERSTORE_iterate(h, + subsystem, + &pid, key, + &iterate_cb, + NULL); } @@ -122,28 +122,28 @@ test_cont (void *cls) * Actually run the test. */ static void -test1 () +test1() { - h = GNUNET_PEERSTORE_connect (cfg); - GNUNET_PEERSTORE_store (h, - subsystem, - &pid, - key, - val, strlen (val) + 1, - GNUNET_TIME_UNIT_FOREVER_ABS, - GNUNET_PEERSTORE_STOREOPTION_REPLACE, - NULL, NULL); - GNUNET_PEERSTORE_disconnect (h, - GNUNET_YES); + h = GNUNET_PEERSTORE_connect(cfg); + GNUNET_PEERSTORE_store(h, + subsystem, + &pid, + key, + val, strlen(val) + 1, + GNUNET_TIME_UNIT_FOREVER_ABS, + GNUNET_PEERSTORE_STOREOPTION_REPLACE, + NULL, NULL); + GNUNET_PEERSTORE_disconnect(h, + GNUNET_YES); h = NULL; /* We need to wait a little bit to give the disconnect a chance to actually finish the operation; otherwise, the test may fail non-deterministically if the new connection is faster than the cleanup routine of the old one. */ - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, - &test_cont, - NULL); + GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, + &test_cont, + NULL); } @@ -155,29 +155,29 @@ test1 () * @param peer handle to our peer (unused) */ static void -run (void *cls, - const struct GNUNET_CONFIGURATION_Handle *c, - struct GNUNET_TESTING_Peer *peer) +run(void *cls, + const struct GNUNET_CONFIGURATION_Handle *c, + struct GNUNET_TESTING_Peer *peer) { cfg = c; - memset (&pid, 1, sizeof (pid)); - test1 (); + memset(&pid, 1, sizeof(pid)); + test1(); } int -main (int argc, char *argv[]) +main(int argc, char *argv[]) { if (0 != - GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync", - "peerstore", - "test_peerstore_api_data.conf", - &run, NULL)) + GNUNET_TESTING_service_run("test-gnunet-peerstore-sync", + "peerstore", + "test_peerstore_api_data.conf", + &run, NULL)) return 1; if (0 != ok) - fprintf (stderr, - "Test failed: %d\n", - ok); + fprintf(stderr, + "Test failed: %d\n", + ok); return ok; } -- cgit v1.2.3