[gtk+/extended-layout-jhs: 5/64] Correct some assumptions, write baseline values to console.
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/extended-layout-jhs: 5/64] Correct some assumptions, write baseline values to console.
- Date: Wed, 25 Nov 2009 11:19:19 +0000 (UTC)
commit ece9a79e491a48c7baf8feac45075373fec1493a
Author: Mathias Hasselmann <mathias hasselmann gmx de>
Date: Wed Jun 20 06:36:23 2007 +0000
Correct some assumptions, write baseline values to console.
2007-06-20 Mathias Hasselmann <mathias hasselmann gmx de>
* tests/autotestextendedlayout.c: Correct some assumptions,
write baseline values to console.
svn path=/branches/extended-layout/; revision=18202
ChangeLog.gtk-extended-layout | 5 ++++
tests/autotestextendedlayout.c | 45 +++++++++++++++++++++++++++++++++++----
2 files changed, 45 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog.gtk-extended-layout b/ChangeLog.gtk-extended-layout
index 29ec248..300e5e1 100644
--- a/ChangeLog.gtk-extended-layout
+++ b/ChangeLog.gtk-extended-layout
@@ -1,5 +1,10 @@
2007-06-20 Mathias Hasselmann <mathias hasselmann gmx de>
+ * tests/autotestextendedlayout.c: Correct some assumptions,
+ write baseline values to console.
+
+2007-06-20 Mathias Hasselmann <mathias hasselmann gmx de>
+
* gtk/gtklabel.c: Remove some late hacking crack.
2007-06-20 Mathias Hasselmann <mathias hasselmann gmx de>
diff --git a/tests/autotestextendedlayout.c b/tests/autotestextendedlayout.c
index a07ff4f..f10911e 100644
--- a/tests/autotestextendedlayout.c
+++ b/tests/autotestextendedlayout.c
@@ -14,6 +14,9 @@
" (actual number %d)", j); \
} G_STMT_END
+#define log_int_array(values, length) \
+ log_int_array_impl (G_STRFUNC, #values, (values), (length))
+
static int num_failures = 0;
static int num_warnings = 0;
static int num_errors = 0;
@@ -22,6 +25,32 @@ static int num_criticals = 0;
static GLogFunc default_log_handler;
static void
+log_int_array_impl (const gchar *function,
+ const gchar *var_name,
+ const gint *values,
+ gsize length)
+{
+ GString *tmp = g_string_new ("");
+
+ if (length--)
+ {
+ g_string_append_printf (tmp, "{ %d", *values++);
+
+ while (length--)
+ g_string_append_printf (tmp, ", %d", *values++);
+
+ g_string_append (tmp, " }");
+ }
+ else
+ {
+ g_string_append (tmp, "empty");
+ }
+
+ g_print ("INFO: %s: %s is %s\n", function, var_name, tmp->str);
+ g_string_free (tmp, TRUE);
+}
+
+static void
log_test (gboolean passed,
const gchar *function,
const gchar *test_name, ...)
@@ -96,20 +125,23 @@ test_label (void)
baselines = NULL;
gtk_label_set_text (label, NULL);
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
- testi (0, num_baselines);
- test (NULL == baselines);
+ log_int_array (baselines, num_baselines);
+ testi (1, num_baselines);
+ test (NULL != baselines);
g_free (baselines);
baselines = NULL;
gtk_label_set_text (label, "");
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
- testi (0, num_baselines);
- test (NULL == baselines);
+ log_int_array (baselines, num_baselines);
+ testi (1, num_baselines);
+ test (NULL != baselines);
g_free (baselines);
baselines = NULL;
gtk_label_set_text (label, "First Line");
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
+ log_int_array (baselines, num_baselines);
testi (1, num_baselines);
test (NULL != baselines);
g_free (baselines);
@@ -117,13 +149,15 @@ test_label (void)
baselines = NULL;
gtk_label_set_text (label, "First Line\n");
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
- testi (1, num_baselines);
+ log_int_array (baselines, num_baselines);
+ testi (2, num_baselines);
test (NULL != baselines);
g_free (baselines);
baselines = NULL;
gtk_label_set_text (label, "First Line\nSecond Line");
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
+ log_int_array (baselines, num_baselines);
testi (2, num_baselines);
test (NULL != baselines);
g_free (baselines);
@@ -131,6 +165,7 @@ test_label (void)
baselines = NULL;
gtk_label_set_markup (label, "First Line\n<big>Second Line</big>\nThird Line");
num_baselines = gtk_extended_layout_get_baselines (layout, &baselines);
+ log_int_array (baselines, num_baselines);
testi (3, num_baselines);
test (NULL != baselines);
g_free (baselines);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]