Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dorota Czaplejewicz
gtk
Commits
5b766102
Commit
5b766102
authored
Sep 01, 2009
by
Kristian Rietveld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More virtual root unit tests
parent
7b1d2de7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
172 additions
and
0 deletions
+172
-0
gtk/tests/filtermodel.c
gtk/tests/filtermodel.c
+172
-0
No files found.
gtk/tests/filtermodel.c
View file @
5b766102
...
...
@@ -715,6 +715,72 @@ unfiltered_hide_single_multi_level (FilterTest *fixture,
}
static
void
unfiltered_vroot_hide_single
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2"
,
FALSE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
-
1
);
}
static
void
unfiltered_vroot_hide_single_child
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2:2"
,
FALSE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
-
1
);
}
static
void
unfiltered_vroot_hide_single_multi_level
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2:2:2"
,
FALSE
);
set_path_visibility
(
fixture
,
"2:2:2"
,
FALSE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2:2"
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
-
1
);
set_path_visibility
(
fixture
,
"2:2:2"
,
TRUE
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2:2"
,
LEVEL_LENGTH
-
1
);
}
static
void
unfiltered_show_single
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
...
...
@@ -781,6 +847,78 @@ unfiltered_show_single_multi_level (FilterTest *fixture,
}
static
void
unfiltered_vroot_show_single
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2"
,
TRUE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
1
);
}
static
void
unfiltered_vroot_show_single_child
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2:2"
,
TRUE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
0
);
/* From here we are filtered, "2" in the real model is "0" in the filter
* model.
*/
set_path_visibility
(
fixture
,
"2:2"
,
TRUE
);
check_level_length
(
fixture
->
filter
,
NULL
,
1
);
check_level_length
(
fixture
->
filter
,
"0"
,
1
);
}
static
void
unfiltered_vroot_show_single_multi_level
(
FilterTest
*
fixture
,
gconstpointer
user_data
)
{
GtkTreePath
*
path
=
(
GtkTreePath
*
)
user_data
;
set_path_visibility
(
fixture
,
"2:2:2:2"
,
TRUE
);
set_path_visibility
(
fixture
,
"2:2:2"
,
TRUE
);
check_level_length
(
fixture
->
filter
,
NULL
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2"
,
LEVEL_LENGTH
);
check_level_length
(
fixture
->
filter
,
"2:2"
,
LEVEL_LENGTH
);
filter_test_enable_filter
(
fixture
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
0
);
/* From here we are filtered, "2" in the real model is "0" in the filter
* model.
*/
set_path_visibility
(
fixture
,
"2:2"
,
TRUE
);
check_filter_model_with_root
(
fixture
,
path
);
check_level_length
(
fixture
->
filter
,
NULL
,
1
);
check_level_length
(
fixture
->
filter
,
"0"
,
1
);
check_level_length
(
fixture
->
filter
,
"0:0"
,
1
);
}
static
gboolean
specific_path_dependent_filter_func
(
GtkTreeModel
*
model
,
GtkTreeIter
*
iter
,
...
...
@@ -1662,6 +1800,24 @@ main (int argc,
unfiltered_hide_single_multi_level
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/hide-single/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_unfiltered
,
unfiltered_vroot_hide_single
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/hide-single-child/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_unfiltered
,
unfiltered_vroot_hide_single_child
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/hide-single-multi-level/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_unfiltered
,
unfiltered_vroot_hide_single_multi_level
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/show-single"
,
FilterTest
,
NULL
,
filter_test_setup_empty_unfiltered
,
...
...
@@ -1678,6 +1834,22 @@ main (int argc,
unfiltered_show_single_multi_level
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/show-single/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_empty_unfiltered
,
unfiltered_vroot_show_single
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/show-single-child/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_empty_unfiltered
,
unfiltered_vroot_show_single_child
,
filter_test_teardown
);
g_test_add
(
"/FilterModel/unfiltered/show-single-multi-level/vroot"
,
FilterTest
,
gtk_tree_path_new_from_indices
(
2
,
-
1
),
filter_test_setup_empty_unfiltered
,
unfiltered_vroot_show_single_multi_level
,
filter_test_teardown
);
g_test_add_func
(
"/FilterModel/specific/path-dependent-filter"
,
specific_path_dependent_filter
);
...
...
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