#include #include #include #include #include #include "../lib/mlp.h" #define DELTA 1e-10 #define EQUALS(A, B) (((A-B) < DELTA)&&((A-B) > -DELTA)) int do_test ; #define MLP_CHECK_ERROR(ctx, n) \ do_test = 1 ; \ if (mlp_context_has_error(ctx)){ \ printf("\n") ; \ switch (mlp_context_get_error(ctx)){ \ case MLP_NOT_SUPPORTED: \ skip(n, "Not supported by this language: %s", mlp_context_get_error_msg(ctx)) ; \ do_test = 0 ; \ break ; \ case MLP_NOT_IMPLEMENTED: \ skip(n, "Not implemented yet in this language: %s", mlp_context_get_error_msg(ctx)) ; \ do_test = 0 ; \ break ; \ default: { \ int i ; \ for (i = 0 ; i < n ; i++){ \ fail("MLP ERROR %d: (%s)", mlp_context_get_error(ctx), mlp_context_get_error_msg(ctx)) ; \ } \ break ; \ } \ } \ } \ if (do_test)