diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-07-22 12:12:24 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-07-22 12:12:24 +0000 |
commit | c425097f2fd148ad8abb87b61bd0b36ff6b9bac2 (patch) | |
tree | 30f24c6390024527ac85670b9fccd9e94d24d67e /src/set/test_set_api.c | |
parent | 78f8e587b93308c7ca1df8d0a17d4247b043c63d (diff) | |
download | gnunet-c425097f2fd148ad8abb87b61bd0b36ff6b9bac2.tar.gz gnunet-c425097f2fd148ad8abb87b61bd0b36ff6b9bac2.zip |
- test for correct uncommited set op destruction
Diffstat (limited to 'src/set/test_set_api.c')
-rw-r--r-- | src/set/test_set_api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/set/test_set_api.c b/src/set/test_set_api.c index db82b83b4..2b809c0e7 100644 --- a/src/set/test_set_api.c +++ b/src/set/test_set_api.c | |||
@@ -173,6 +173,8 @@ run (void *cls, | |||
173 | struct GNUNET_TESTING_Peer *peer) | 173 | struct GNUNET_TESTING_Peer *peer) |
174 | { | 174 | { |
175 | 175 | ||
176 | struct GNUNET_SET_OperationHandle *my_oh; | ||
177 | |||
176 | config = cfg; | 178 | config = cfg; |
177 | GNUNET_CRYPTO_get_host_identity (cfg, &local_id); | 179 | GNUNET_CRYPTO_get_host_identity (cfg, &local_id); |
178 | printf ("my id (from CRYPTO): %s\n", GNUNET_h2s (&local_id.hashPubKey)); | 180 | printf ("my id (from CRYPTO): %s\n", GNUNET_h2s (&local_id.hashPubKey)); |
@@ -181,6 +183,14 @@ run (void *cls, | |||
181 | set1 = GNUNET_SET_create (cfg, GNUNET_SET_OPERATION_UNION); | 183 | set1 = GNUNET_SET_create (cfg, GNUNET_SET_OPERATION_UNION); |
182 | set2 = GNUNET_SET_create (cfg, GNUNET_SET_OPERATION_UNION); | 184 | set2 = GNUNET_SET_create (cfg, GNUNET_SET_OPERATION_UNION); |
183 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &app_id); | 185 | GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &app_id); |
186 | |||
187 | /* test if canceling an uncommited request works! */ | ||
188 | my_oh = GNUNET_SET_prepare (&local_id, &app_id, NULL, 0, | ||
189 | GNUNET_SET_RESULT_ADDED, NULL, NULL); | ||
190 | |||
191 | GNUNET_SET_operation_cancel (my_oh); | ||
192 | |||
193 | /* test the real set reconciliation */ | ||
184 | init_set1 (); | 194 | init_set1 (); |
185 | } | 195 | } |
186 | 196 | ||