- core = GNUNET_CORE_connect (cfg_,
- 42,
- NULL,
- init,
- connect_cb,
- NULL, NULL, NULL, 0, NULL, 0, handlers);
- GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls);
+
+ core_cfg = GNUNET_CONFIGURATION_create ();
+
+ arm_proc =
+ GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+ "gnunet-service-arm",
+#if VERBOSE
+ "-L", "DEBUG",
+#endif
+ "-c", "test_core_api_peer1.conf", NULL);
+
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONFIGURATION_load (core_cfg,
+ "test_core_api_peer1.conf"));
+
+ core =
+ GNUNET_CORE_connect (core_cfg, 42, NULL, &init, &connect_cb, NULL, NULL,
+ 0, NULL, 0, handlers);
+
+ die_task =
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_SECONDS, 60), &cleanup,
+ cls);
+}
+
+
+static int
+check ()
+{
+ char *const argv[] = { "test-core-api-send-to-self",
+ "-c",
+ "test_core_api_data.conf",
+#if VERBOSE
+ "-L", "DEBUG",
+#endif
+ NULL
+ };
+
+ static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_END
+ };
+
+ ret = 1;
+
+ return (GNUNET_OK ==
+ GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
+ "test_core_api_send_to_self",
+ gettext_noop ("help text"), options, &run,
+ NULL)) ? ret : 1;