From 7f4029638207beca67b86927413c07e632527aad Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 14 Jun 2013 13:33:32 +0100 Subject: [PATCH] Sort exactness errors. --- src/bin/exactness.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bin/exactness.c b/src/bin/exactness.c index 64ac78d..da4c36f 100644 --- a/src/bin/exactness.c +++ b/src/bin/exactness.c @@ -8,6 +8,21 @@ #include "config.h" +static int +_errors_sort_cb(List_Entry *a, List_Entry *b) +{ + return strcmp(a->name, b->name); +} + +static void +_exactness_errors_sort(Exactness_Ctx *ctx) +{ + ctx->errors = + eina_list_sort(ctx->errors, 0, (Eina_Compare_Cb) _errors_sort_cb); + ctx->compare_errors = + eina_list_sort(ctx->compare_errors, 0, (Eina_Compare_Cb) strcmp); +} + static const Ecore_Getopt optdesc = { "exactness", "%prog [options] <-r|-p|-i|-s> ", @@ -171,6 +186,9 @@ main(int argc, char *argv[]) exactness_ctx.tests_executed, eina_inlist_count(EINA_INLIST_GET(test_list))); + /* Sort the errors and the compare_errors. */ + _exactness_errors_sort(&exactness_ctx); + if (exactness_ctx.errors || exactness_ctx.compare_errors) { FILE *report_file;