+ static struct GNUNET_IDENTITY_Ego *my_ego;
+ static int round;
+
+ switch (round)
+ {
+ case 0: /* end of initial iteration */
+ GNUNET_assert (NULL == ego);
+ GNUNET_assert (NULL == identifier);
+ break;
+ case 1: /* create */
+ GNUNET_assert (NULL != ego);
+ GNUNET_assert (0 == strcmp (identifier, "test-id"));
+ my_ego = ego;
+ *ctx = &round;
+ break;
+ case 2: /* rename */
+ GNUNET_assert (my_ego == ego);
+ GNUNET_assert (0 == strcmp (identifier, "test"));
+ GNUNET_assert (*ctx == &round);
+ break;
+ case 3: /* delete */
+ GNUNET_assert (my_ego == ego);
+ GNUNET_assert (NULL == identifier);
+ GNUNET_assert (*ctx == &round);
+ *ctx = NULL;
+ break;
+ default:
+ GNUNET_break (0);
+ }
+ round++;
+}
+
+
+/**
+ * Continuation called from successful delete operation.
+ *
+ * @param cls NULL
+ * @param emsg (should also be NULL)
+ */
+static void
+delete_cont (void *cls,
+ const char *emsg)
+{
+ op = NULL;
+ GNUNET_assert (NULL == emsg);
+ end ();
+}
+
+
+/**
+ * Continuation called from expected-to-fail rename operation.
+ *
+ * @param cls NULL
+ * @param emsg (should also be NULL)
+ */
+static void
+fail_rename_cont (void *cls,
+ const char *emsg)
+{
+ GNUNET_assert (NULL != emsg);
+ op = GNUNET_IDENTITY_delete (h,
+ "test",
+ &delete_cont,
+ NULL);
+ end (); /* yepee */
+}
+
+
+/**
+ * Continuation called from successful rename operation.
+ *
+ * @param cls NULL
+ * @param emsg (should also be NULL)
+ */
+static void
+success_rename_cont (void *cls,
+ const char *emsg)
+{
+ GNUNET_assert (NULL == emsg);
+ op = GNUNET_IDENTITY_rename (h,
+ "test-id",
+ "test",
+ &fail_rename_cont,
+ NULL);