aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
committerLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
commite0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch)
treeecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/testing
parent92fd84dc7ef98452f848a62677c61a2b80b5835e (diff)
downloadgnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.tar.gz
gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.zip
malloc -> new
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_peerstartup.c2
-rw-r--r--src/testing/test_testing_peerstartup2.c2
-rw-r--r--src/testing/test_testing_sharedservices.c2
-rw-r--r--src/testing/testing.c8
4 files changed, 7 insertions, 7 deletions
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c
index b871ed1e3..e025b4138 100644
--- a/src/testing/test_testing_peerstartup.c
+++ b/src/testing/test_testing_peerstartup.c
@@ -95,7 +95,7 @@ run (void *cls, char *const *args, const char *cfgfile,
95 char *emsg; 95 char *emsg;
96 struct GNUNET_PeerIdentity id; 96 struct GNUNET_PeerIdentity id;
97 97
98 test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); 98 test_ctx = GNUNET_new (struct TestingContext);
99 test_ctx->system = 99 test_ctx->system =
100 GNUNET_TESTING_system_create ("test-gnunet-testing", 100 GNUNET_TESTING_system_create ("test-gnunet-testing",
101 "127.0.0.1", NULL, NULL); 101 "127.0.0.1", NULL, NULL);
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index a4bdd4d65..2bdae72eb 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -164,7 +164,7 @@ run (void *cls, char *const *args, const char *cfgfile,
164 char *emsg; 164 char *emsg;
165 struct GNUNET_PeerIdentity id; 165 struct GNUNET_PeerIdentity id;
166 166
167 test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); 167 test_ctx = GNUNET_new (struct TestingContext);
168 test_ctx->system = 168 test_ctx->system =
169 GNUNET_TESTING_system_create ("test-gnunet-testing", 169 GNUNET_TESTING_system_create ("test-gnunet-testing",
170 "127.0.0.1", NULL, NULL); 170 "127.0.0.1", NULL, NULL);
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c
index 5b5bc0a24..e2f956e62 100644
--- a/src/testing/test_testing_sharedservices.c
+++ b/src/testing/test_testing_sharedservices.c
@@ -107,7 +107,7 @@ run (void *cls, char *const *args, const char *cfgfile,
107 struct GNUNET_TESTING_Peer *peer; 107 struct GNUNET_TESTING_Peer *peer;
108 unsigned int cnt; 108 unsigned int cnt;
109 109
110 test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); 110 test_ctx = GNUNET_new (struct TestingContext);
111 test_ctx->system = 111 test_ctx->system =
112 GNUNET_TESTING_system_create ("test-gnunet-testing", 112 GNUNET_TESTING_system_create ("test-gnunet-testing",
113 "127.0.0.1", NULL, ss); 113 "127.0.0.1", NULL, ss);
diff --git a/src/testing/testing.c b/src/testing/testing.c
index f414032a0..5cb823575 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -387,7 +387,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir,
387 unsigned int cnt; 387 unsigned int cnt;
388 388
389 GNUNET_assert (NULL != testdir); 389 GNUNET_assert (NULL != testdir);
390 system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System)); 390 system = GNUNET_new (struct GNUNET_TESTING_System);
391 if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX))) 391 if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX)))
392 system->tmppath = GNUNET_DISK_mkdtemp (testdir); 392 system->tmppath = GNUNET_DISK_mkdtemp (testdir);
393 else 393 else
@@ -413,7 +413,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir,
413 for (cnt = 0; NULL != shared_services[cnt].service; cnt++) 413 for (cnt = 0; NULL != shared_services[cnt].service; cnt++)
414 { 414 {
415 tss = shared_services[cnt]; 415 tss = shared_services[cnt];
416 ss = GNUNET_malloc (sizeof (struct SharedService)); 416 ss = GNUNET_new (struct SharedService);
417 ss->sname = GNUNET_strdup (tss.service); 417 ss->sname = GNUNET_strdup (tss.service);
418 ss->cfg = GNUNET_CONFIGURATION_create (); 418 ss->cfg = GNUNET_CONFIGURATION_create ();
419 GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname, 419 GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname,
@@ -1242,7 +1242,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
1242 GNUNET_free (config_filename); 1242 GNUNET_free (config_filename);
1243 goto err_ret; 1243 goto err_ret;
1244 } 1244 }
1245 peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); 1245 peer = GNUNET_new (struct GNUNET_TESTING_Peer);
1246 peer->ss_instances = ss_instances; 1246 peer->ss_instances = ss_instances;
1247 peer->cfgfile = config_filename; /* Free in peer_destroy */ 1247 peer->cfgfile = config_filename; /* Free in peer_destroy */
1248 peer->cfg = GNUNET_CONFIGURATION_dup (cfg); 1248 peer->cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -1291,7 +1291,7 @@ GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer,
1291 memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity)); 1291 memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity));
1292 return; 1292 return;
1293 } 1293 }
1294 peer->id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); 1294 peer->id = GNUNET_new (struct GNUNET_PeerIdentity);
1295 GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system, 1295 GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system,
1296 peer->key_number, 1296 peer->key_number,
1297 peer->id)); 1297 peer->id));