Commit bfe3d851 authored by Maciej Stachowiak's avatar Maciej Stachowiak

Un #if-0'd out, and replaced the free that was killing things with a

	* libnautilus-extensions/nautilus-glib-extensions.c:
	(nautilus_test_predicate), (nautilus_self_check_glib_extensions):
	Un #if-0'd out, and replaced the free that was killing things with
	a comment explaining why it is not necessary.
parent 1b1159ad
2000-06-06 Maciej Stachowiak <mjs@eazel.com>
* libnautilus-extensions/nautilus-glib-extensions.c:
(nautilus_test_predicate), (nautilus_self_check_glib_extensions):
Un #if-0'd out, and replaced the free that was killing things with
a comment explaining why it is not necessary.
2000-06-06 Ramiro Estrugo <ramiro@eazel.com>
* nautilus-widgets/nautilus-preferences.c:
......
......@@ -543,7 +543,6 @@ check_tm_to_g_date (time_t time)
/* FIXME bugzilla.eazel.com 1277:
* nautilus_g_list_partition test is broken.
*/
#if 0
static gboolean
nautilus_test_predicate (char *data,
char *user_data)
......@@ -554,7 +553,6 @@ nautilus_test_predicate (char *data,
return FALSE;
}
}
#endif
void
nautilus_self_check_glib_extensions (void)
......@@ -566,7 +564,12 @@ nautilus_self_check_glib_extensions (void)
GList *compare_list_4;
GList *compare_list_5;
gint64 time1, time2;
GList *list_to_partition;
GList *expected_passed;
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
check_tm_to_g_date (time (NULL)); /* current time */
......@@ -629,44 +632,38 @@ nautilus_self_check_glib_extensions (void)
/* FIXME bugzilla.eazel.com 1277:
* nautilus_g_list_partition test is broken.
*/
#if 0
/* nautilus_g_list_partition */
{
GList *list_to_partition;
GList *expected_passed;
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
list_to_partition = NULL;
list_to_partition = g_list_append (list_to_partition, "Cadillac");
list_to_partition = g_list_append (list_to_partition, "Pontiac");
list_to_partition = g_list_append (list_to_partition, "Ford");
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_failed, actual_failed), TRUE);
g_list_free (list_to_partition);
g_list_free (expected_passed);
g_list_free (actual_passed);
g_list_free (expected_failed);
g_list_free (actual_failed);
}
#endif
list_to_partition = NULL;
list_to_partition = g_list_append (list_to_partition, "Cadillac");
list_to_partition = g_list_append (list_to_partition, "Pontiac");
list_to_partition = g_list_append (list_to_partition, "Ford");
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_failed, actual_failed), TRUE);
/* Don't free list_to_partition, since it is consumed
by nautilus_g_list_partition */
g_list_free (expected_passed);
g_list_free (actual_passed);
g_list_free (expected_failed);
g_list_free (actual_failed);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
......@@ -543,7 +543,6 @@ check_tm_to_g_date (time_t time)
/* FIXME bugzilla.eazel.com 1277:
* nautilus_g_list_partition test is broken.
*/
#if 0
static gboolean
nautilus_test_predicate (char *data,
char *user_data)
......@@ -554,7 +553,6 @@ nautilus_test_predicate (char *data,
return FALSE;
}
}
#endif
void
nautilus_self_check_glib_extensions (void)
......@@ -566,7 +564,12 @@ nautilus_self_check_glib_extensions (void)
GList *compare_list_4;
GList *compare_list_5;
gint64 time1, time2;
GList *list_to_partition;
GList *expected_passed;
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
check_tm_to_g_date (0); /* lower limit */
check_tm_to_g_date ((time_t) -1); /* upper limit */
check_tm_to_g_date (time (NULL)); /* current time */
......@@ -629,44 +632,38 @@ nautilus_self_check_glib_extensions (void)
/* FIXME bugzilla.eazel.com 1277:
* nautilus_g_list_partition test is broken.
*/
#if 0
/* nautilus_g_list_partition */
{
GList *list_to_partition;
GList *expected_passed;
GList *expected_failed;
GList *actual_passed;
GList *actual_failed;
list_to_partition = NULL;
list_to_partition = g_list_append (list_to_partition, "Cadillac");
list_to_partition = g_list_append (list_to_partition, "Pontiac");
list_to_partition = g_list_append (list_to_partition, "Ford");
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_failed, actual_failed), TRUE);
g_list_free (list_to_partition);
g_list_free (expected_passed);
g_list_free (actual_passed);
g_list_free (expected_failed);
g_list_free (actual_failed);
}
#endif
list_to_partition = NULL;
list_to_partition = g_list_append (list_to_partition, "Cadillac");
list_to_partition = g_list_append (list_to_partition, "Pontiac");
list_to_partition = g_list_append (list_to_partition, "Ford");
list_to_partition = g_list_append (list_to_partition, "Range Rover");
expected_passed = NULL;
expected_passed = g_list_append (expected_passed, "Cadillac");
expected_passed = g_list_append (expected_passed, "Ford");
expected_failed = NULL;
expected_failed = g_list_append (expected_failed, "Pontiac");
expected_failed = g_list_append (expected_failed, "Range Rover");
actual_passed = nautilus_g_list_partition (list_to_partition,
(NautilusGPredicateFunc) nautilus_test_predicate,
"m",
&actual_failed);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_passed, actual_passed), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_g_str_list_equal (expected_failed, actual_failed), TRUE);
/* Don't free list_to_partition, since it is consumed
by nautilus_g_list_partition */
g_list_free (expected_passed);
g_list_free (actual_passed);
g_list_free (expected_failed);
g_list_free (actual_failed);
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment