test_fs_start_stop.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. This file is part of GNUnet.
  3. (C) 2004, 2005, 2006, 2009 Christian Grothoff (and other contributing authors)
  4. GNUnet is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published
  6. by the Free Software Foundation; either version 3, or (at your
  7. 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. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNUnet; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17. /**
  18. * @file fs/test_fs_start_stop.c
  19. * @brief testcase for fs.c (start-stop only)
  20. * @author Christian Grothoff
  21. */
  22. #include "platform.h"
  23. #include "gnunet_util_lib.h"
  24. #include "gnunet_testing_lib.h"
  25. #include "gnunet_fs_service.h"
  26. static void *
  27. progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
  28. {
  29. return NULL;
  30. }
  31. static void
  32. run (void *cls,
  33. const struct GNUNET_CONFIGURATION_Handle *cfg,
  34. struct GNUNET_TESTING_Peer *peer)
  35. {
  36. struct GNUNET_FS_Handle *fs;
  37. fs = GNUNET_FS_start (cfg, "test-fs-start-stop", &progress_cb, NULL,
  38. GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
  39. GNUNET_assert (NULL != fs);
  40. GNUNET_FS_stop (fs);
  41. }
  42. int
  43. main (int argc, char *argv[])
  44. {
  45. if (0 != GNUNET_TESTING_peer_run ("test-fs-start-stop",
  46. "test_fs_data.conf",
  47. &run, NULL))
  48. return 1;
  49. return 0;
  50. }
  51. /* end of test_fs_start_stop.c */