test_fs_start_stop.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. This file is part of GNUnet.
  3. Copyright (C) 2004, 2005, 2006, 2009 GNUnet e.V.
  4. GNUnet is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License,
  7. or (at your option) any later version.
  8. GNUnet is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. SPDX-License-Identifier: AGPL3.0-or-later
  15. */
  16. /**
  17. * @file fs/test_fs_start_stop.c
  18. * @brief testcase for fs.c (start-stop only)
  19. * @author Christian Grothoff
  20. */
  21. #include "platform.h"
  22. #include "gnunet_util_lib.h"
  23. #include "gnunet_testing_lib.h"
  24. #include "gnunet_fs_service.h"
  25. static void *
  26. progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
  27. {
  28. return NULL;
  29. }
  30. static void
  31. run (void *cls,
  32. const struct GNUNET_CONFIGURATION_Handle *cfg,
  33. struct GNUNET_TESTING_Peer *peer)
  34. {
  35. struct GNUNET_FS_Handle *fs;
  36. fs = GNUNET_FS_start (cfg, "test-fs-start-stop", &progress_cb, NULL,
  37. GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
  38. GNUNET_assert (NULL != fs);
  39. GNUNET_FS_stop (fs);
  40. }
  41. int
  42. main (int argc, char *argv[])
  43. {
  44. if (0 != GNUNET_TESTING_peer_run ("test-fs-start-stop",
  45. "test_fs_data.conf",
  46. &run, NULL))
  47. return 1;
  48. return 0;
  49. }
  50. /* end of test_fs_start_stop.c */