staticvoid
test_append (void)
{
GtkTreePath *p; int i; int *indices;
p = gtk_tree_path_new (); for (i = 0; i < 100; i++)
{
g_assert_cmpint (gtk_tree_path_get_depth (p), ==, i);
gtk_tree_path_append_index (p, i);
}
indices = gtk_tree_path_get_indices (p); for (i = 0; i < 100; i++)
g_assert_cmpint (indices[i], ==, i);
gtk_tree_path_free (p);
}
staticvoid
test_prepend (void)
{
GtkTreePath *p; int i; int *indices;
p = gtk_tree_path_new (); for (i = 0; i < 100; i++)
{
g_assert_cmpint (gtk_tree_path_get_depth (p), ==, i);
gtk_tree_path_prepend_index (p, i);
}
indices = gtk_tree_path_get_indices (p); for (i = 0; i < 100; i++)
g_assert_cmpint (indices[i], ==, 99 - i);
gtk_tree_path_free (p);
}
staticvoid
test_to_string (void)
{ constchar *str = "0:1:2:3:4:5:6:7:8:9:10";
GtkTreePath *p; int *indices; char *s; int i;
p = gtk_tree_path_new_from_string (str);
indices = gtk_tree_path_get_indices (p); for (i = 0; i < 10; i++)
g_assert_cmpint (indices[i], ==, i);
s = gtk_tree_path_to_string (p);
g_assert_cmpstr (s, ==, str);
gtk_tree_path_free (p);
g_free (s);
}
staticvoid
test_from_indices (void)
{
GtkTreePath *p; int *indices; int i;
p = gtk_tree_path_new_from_indices (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1);
g_assert_cmpint (gtk_tree_path_get_depth (p), ==, 10);
indices = gtk_tree_path_get_indices (p); for (i = 0; i < 10; i++)
g_assert_cmpint (indices[i], ==, i);
gtk_tree_path_free (p);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.