Exemplo n.º 1
0
void
dump_action_list( action_list *list, void dump_function( const char *format, ... ) ) {
  assert( dump_function != NULL );

  for ( dlist_element *e = get_first_element( list ); e != NULL; e = e->next ) {
    if ( e->data == NULL ) {
      continue;
    }
    dump_action( e->data, dump_function );
  }
}
Exemplo n.º 2
0
void camel_test_failv (const gchar *why, va_list ap)
{
	gchar *text;
	struct _state *s;

	CAMEL_TEST_LOCK;

	s = current_state ();

	text = g_strdup_vprintf (why, ap);

	if ((s->nonfatal == 0 && camel_test_verbose > 0)
	    || (s->nonfatal && camel_test_verbose > 1)) {
		printf("Failed.\n%s\n", text);
		camel_test_break ();
	}

	g_free (text);

	if ((s->nonfatal == 0 && camel_test_verbose > 0)
	    || (s->nonfatal && camel_test_verbose > 2)) {
		g_hash_table_foreach (info_table, (GHFunc)dump_action, 0);
	}

	if (s->nonfatal == 0) {
		exit (1);
	} else {
		ok=0;
		if (camel_test_verbose > 1) {
			printf("Known problem (ignored):\n");
			dump_action (CAMEL_TEST_ID, s, 0);
		}
	}

	CAMEL_TEST_UNLOCK;
}