summaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_limited_sockets.c
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/transport/test_transport_api_limited_sockets.c
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
uncrustify as demanded.
Diffstat (limited to 'src/transport/test_transport_api_limited_sockets.c')
-rw-r--r--src/transport/test_transport_api_limited_sockets.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index d5c6934b5..a5d40479f 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.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 <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @file transport/test_transport_api_limited_sockets.c
* @brief base test case for transport implementations
@@ -33,7 +33,7 @@
/**
* How long until we give up on transmitting the message?
*/
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
+#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 300)
#define MAX_FILES 50
@@ -44,32 +44,32 @@ static struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc;
static void
-notify_receive (void *cls,
- struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver,
- const struct GNUNET_PeerIdentity *sender,
- const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
+notify_receive(void *cls,
+ struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver,
+ const struct GNUNET_PeerIdentity *sender,
+ const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received message of type %d from peer %s!\n",
- ntohs (message->header.type),
- GNUNET_i2s (sender));
- if ( (GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE ==
- ntohs (message->header.type)) &&
- (sizeof (struct GNUNET_TRANSPORT_TESTING_TestMessage) ==
- ntohs (message->header.size)) )
- {
- ccc->global_ret = GNUNET_OK;
- }
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "Received message of type %d from peer %s!\n",
+ ntohs(message->header.type),
+ GNUNET_i2s(sender));
+ if ((GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE ==
+ ntohs(message->header.type)) &&
+ (sizeof(struct GNUNET_TRANSPORT_TESTING_TestMessage) ==
+ ntohs(message->header.size)))
+ {
+ ccc->global_ret = GNUNET_OK;
+ }
else
- {
- GNUNET_break (0);
- }
- GNUNET_SCHEDULER_shutdown ();
+ {
+ GNUNET_break(0);
+ }
+ GNUNET_SCHEDULER_shutdown();
}
int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
{
struct GNUNET_TRANSPORT_TESTING_SendClosure sc = {
.num_messages = 1
@@ -89,26 +89,26 @@ main (int argc, char *argv[])
int res;
sc.ccc = &my_ccc;
- res = getrlimit (RLIMIT_NOFILE,
- &r_file_old);
+ res = getrlimit(RLIMIT_NOFILE,
+ &r_file_old);
r_file_new.rlim_cur = MAX_FILES;
r_file_new.rlim_max = r_file_old.rlim_max;
- res = setrlimit (RLIMIT_NOFILE,
- &r_file_new);
+ res = setrlimit(RLIMIT_NOFILE,
+ &r_file_new);
if (0 != res)
- {
- fprintf (stderr,
- "Setting limit failed: %s\n",
- strerror (errno));
- return 77;
- }
+ {
+ fprintf(stderr,
+ "Setting limit failed: %s\n",
+ strerror(errno));
+ return 77;
+ }
ccc = &my_ccc;
ccc->global_ret = GNUNET_SYSERR;
if (GNUNET_OK !=
- GNUNET_TRANSPORT_TESTING_main (2,
- &GNUNET_TRANSPORT_TESTING_connect_check,
- ccc))
+ GNUNET_TRANSPORT_TESTING_main(2,
+ &GNUNET_TRANSPORT_TESTING_connect_check,
+ ccc))
return 1;
return 0;
}
@@ -118,10 +118,10 @@ main (int argc, char *argv[])
int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
{
- fprintf (stderr,
- "Cannot run test on this system\n");
+ fprintf(stderr,
+ "Cannot run test on this system\n");
return 77;
}