[gtk+] Add tests for parsing int64/uin64 in GtkBuilder



commit bcb9eabf11b45480972070d0fc866de11b1667f0
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 21 14:21:34 2014 -0400

    Add tests for parsing int64/uin64 in GtkBuilder
    
    This tests the fix in the previous commit.

 testsuite/gtk/builder.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index ba1f7a1..1ae779c 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -1788,6 +1788,16 @@ test_value_from_string (void)
   g_assert (g_value_get_uint (&value) == 2345);
   g_value_unset (&value);
 
+  g_assert (gtk_builder_value_from_string_type (builder, G_TYPE_INT64, "-2345", &value, &error));
+  g_assert (G_VALUE_HOLDS_INT64 (&value));
+  g_assert (g_value_get_int64 (&value) == -2345);
+  g_value_unset (&value);
+
+  g_assert (gtk_builder_value_from_string_type (builder, G_TYPE_UINT64, "2345", &value, &error));
+  g_assert (G_VALUE_HOLDS_UINT64 (&value));
+  g_assert (g_value_get_uint64 (&value) == 2345);
+  g_value_unset (&value);
+
   g_assert (gtk_builder_value_from_string_type (builder, G_TYPE_FLOAT, "1.454", &value, &error));
   g_assert (G_VALUE_HOLDS_FLOAT (&value));
   g_assert (fabs (g_value_get_float (&value) - 1.454) < 0.00001);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]