Code

data_test: Print type of datum in case of a test failure.
[sysdb.git] / t / core / data_test.c
index 954201451b35c88bd9fbe29a4ba3f038edd635df..d6bd01459bc83019a9fee93f51c399933a24a919 100644 (file)
@@ -163,10 +163,12 @@ START_TEST(test_format)
 
                check = sdb_data_format(&golden_data[i].datum, buf);
                fail_unless(! check,
-                               "sdb_data_format() = %d; expected: 0", check);
+                               "sdb_data_format(type=%s) = %d; expected: 0",
+                               SDB_TYPE_TO_STRING(golden_data[i].datum.type), check);
                string = sdb_strbuf_string(buf);
                fail_unless(! strcmp(string, golden_data[i].expected),
-                               "sdb_data_format() used wrong format: %s; expected: %s",
+                               "sdb_data_format(type=%s) used wrong format: %s; expected: %s",
+                               SDB_TYPE_TO_STRING(golden_data[i].datum.type),
                                string, golden_data[i].expected);
                sdb_strbuf_clear(buf);
        }