Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Dorota Czaplejewicz
gtk
Commits
7b1d2de7
Commit
7b1d2de7
authored
Sep 01, 2009
by
Kristian Rietveld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a rather specially crafted test case
parent
af73305d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
gtk/tests/filtermodel.c
gtk/tests/filtermodel.c
+40
-0
No files found.
gtk/tests/filtermodel.c
View file @
7b1d2de7
...
@@ -1053,6 +1053,44 @@ specific_sort_filter_remove_root (void)
...
@@ -1053,6 +1053,44 @@ specific_sort_filter_remove_root (void)
}
}
static
void
specific_root_mixed_visibility
(
void
)
{
int
i
;
/* A bit nasty, apologies */
GtkWidget
*
view
;
GtkTreeModel
*
filter
;
FilterTest
fixture
;
fixture
.
store
=
gtk_tree_store_new
(
2
,
G_TYPE_STRING
,
G_TYPE_BOOLEAN
);
for
(
i
=
0
;
i
<
LEVEL_LENGTH
;
i
++
)
{
GtkTreeIter
iter
;
gtk_tree_store_insert
(
fixture
.
store
,
&
iter
,
NULL
,
i
);
if
(
i
%
2
==
0
)
create_tree_store_set_values
(
fixture
.
store
,
&
iter
,
TRUE
);
else
create_tree_store_set_values
(
fixture
.
store
,
&
iter
,
FALSE
);
}
filter
=
gtk_tree_model_filter_new
(
GTK_TREE_MODEL
(
fixture
.
store
),
NULL
);
fixture
.
filter
=
GTK_TREE_MODEL_FILTER
(
filter
);
gtk_tree_model_filter_set_visible_column
(
fixture
.
filter
,
1
);
/* In order to trigger the potential bug, we should not access
* the filter model here (so don't call the check functions).
*/
/* Change visibility of an odd row to TRUE */
set_path_visibility
(
&
fixture
,
"3"
,
TRUE
);
check_filter_model
(
&
fixture
);
check_level_length
(
fixture
.
filter
,
NULL
,
4
);
}
static
void
static
void
specific_filter_add_child
(
void
)
specific_filter_add_child
(
void
)
{
{
...
@@ -1649,6 +1687,8 @@ main (int argc,
...
@@ -1649,6 +1687,8 @@ main (int argc,
specific_sort_filter_remove_node
);
specific_sort_filter_remove_node
);
g_test_add_func
(
"/FilterModel/specific/sort-filter-remove-root"
,
g_test_add_func
(
"/FilterModel/specific/sort-filter-remove-root"
,
specific_sort_filter_remove_root
);
specific_sort_filter_remove_root
);
g_test_add_func
(
"/FilterModel/specific/root-mixed-visibility"
,
specific_root_mixed_visibility
);
g_test_add_func
(
"/FilterModel/specific/filter-add-child"
,
g_test_add_func
(
"/FilterModel/specific/filter-add-child"
,
specific_filter_add_child
);
specific_filter_add_child
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment