* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
path = gtk_tree_path_new_from_indices (1, -1);
gtk_tree_view_expand_row (GTK_TREE_VIEW (tree_view), path, TRUE);
+ gtk_tree_path_free (path);
assert_node_ref_count (ref_model, &grandparent1, 1);
assert_node_ref_count (ref_model, &grandparent2, 2);
/* change the "E" row in a way that causes it to change position */
gtk_tree_model_get_iter (child_model, &iter, path);
gtk_tree_store_set (GTK_TREE_STORE (child_model), &iter, 0, "A", -1);
+
+ gtk_tree_path_free (path);
}
static void
gtk_tree_model_sort_clear_cache (GTK_TREE_MODEL_SORT (s_model));
}
+static void
+iter_test (GtkTreeModel *model)
+{
+ GtkTreeIter a, b;
+
+ g_assert (gtk_tree_model_get_iter_first (model, &a));
+
+ g_assert (gtk_tree_model_iter_next (model, &a));
+ g_assert (gtk_tree_model_iter_next (model, &a));
+ b = a;
+ g_assert (!gtk_tree_model_iter_next (model, &b));
+
+ g_assert (gtk_tree_model_iter_previous (model, &a));
+ g_assert (gtk_tree_model_iter_previous (model, &a));
+ b = a;
+ g_assert (!gtk_tree_model_iter_previous (model, &b));
+}
+
+static void
+specific_bug_674587 (void)
+{
+ GtkListStore *l;
+ GtkTreeStore *t;
+ GtkTreeModel *m;
+ GtkTreeIter a;
+
+ l = gtk_list_store_new (1, G_TYPE_STRING);
+
+ gtk_list_store_append (l, &a);
+ gtk_list_store_set (l, &a, 0, "0", -1);
+ gtk_list_store_append (l, &a);
+ gtk_list_store_set (l, &a, 0, "1", -1);
+ gtk_list_store_append (l, &a);
+ gtk_list_store_set (l, &a, 0, "2", -1);
+
+ iter_test (GTK_TREE_MODEL (l));
+
+ g_object_unref (l);
+
+ t = gtk_tree_store_new (1, G_TYPE_STRING);
+
+ gtk_tree_store_append (t, &a, NULL);
+ gtk_tree_store_set (t, &a, 0, "0", -1);
+ gtk_tree_store_append (t, &a, NULL);
+ gtk_tree_store_set (t, &a, 0, "1", -1);
+ gtk_tree_store_append (t, &a, NULL);
+ gtk_tree_store_set (t, &a, 0, "2", -1);
+
+ iter_test (GTK_TREE_MODEL (t));
+
+ m = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (t));
+
+ iter_test (m);
+
+ g_object_unref (t);
+ g_object_unref (m);
+}
+
/* main */
void
specific_bug_300089);
g_test_add_func ("/TreeModelSort/specific/bug-364946",
specific_bug_364946);
+ g_test_add_func ("/TreeModelSort/specific/bug-674587",
+ specific_bug_674587);
}
+