Remove critical log handler; we can't trigger g_return_if_fails() in our
authorOwen Taylor <otaylor@redhat.com>
Sun, 14 Mar 2004 04:27:26 +0000 (04:27 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 14 Mar 2004 04:27:26 +0000 (04:27 +0000)
Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>

        * tests/env-test.c (main): Remove critical log handler;
        we can't trigger g_return_if_fails() in our test suite
        even silently, because the user could have compiled
        with --disable-debug. #if 0 the tests for
        g_setenv/g_unsetenv with a "foo=bar" variable name.
        (#136709, reported by Frédéric L. W. Meunier)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/env-test.c

index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 7ef2f280346fe5fcdffa28d6cda644c305b541fb..2e377cc847545cc13b4fcd3e2db0dec54bfa2a1d 100644 (file)
@@ -1,3 +1,12 @@
+Sat Mar 13 23:18:45 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * tests/env-test.c (main): Remove critical log handler;
+       we can't trigger g_return_if_fails() in our test suite
+       even silently, because the user could have compiled
+       with --disable-debug. #if 0 the tests for
+       g_setenv/g_unsetenv with a "foo=bar" variable name.
+       (#136709, reported by Frédéric L. W. Meunier)
+
 Sat Mar 13 23:10:35 2004  Owen Taylor  <otaylor@redhat.com>
 
        Some warning fixes for the Sun compiler (Reported by 
index 2ec0cf41a1411782cd39f8c2c3cf65f073a3b528..5fd75df3b7c3eb3b025a14e646fe942cd8f695e1 100644 (file)
 #include <unistd.h>
 #endif
 
-static void 
-_log (const gchar   *log_domain,
-     GLogLevelFlags log_level,
-     const gchar   *message,
-     gpointer       user_data)
-{
-  /* Silence g_assert () and friends.
-   */
-}
-
 int 
 main (int argc, char *argv[])
 {
@@ -62,8 +52,6 @@ main (int argc, char *argv[])
   gchar *value1 = "works";
   gchar *value2 = "again";
 
-  g_log_set_handler ("GLib", G_LOG_LEVEL_CRITICAL, _log, NULL);
-
   data = g_getenv (variable);
   g_assert (data == NULL && "TEST_G_SETENV already set");
   
@@ -94,8 +82,13 @@ main (int argc, char *argv[])
   data = g_getenv (variable);
   g_assert (data == NULL && "g_unsetenv() doesn't work");
 
+#if 0
+  /* We can't test this, because it's an illegal argument that
+   * we g_return_if_fail for.
+   */
   result = g_setenv ("foo=bar", "baz", TRUE);
   g_assert (!result && "g_setenv() accepts '=' in names");
+#endif  
 
   result = g_setenv ("foo", "bar=baz", TRUE);
   g_assert (result && "g_setenv() doesn't accept '=' in values");
@@ -108,10 +101,14 @@ main (int argc, char *argv[])
 #endif
   data = g_getenv ("foo");
   g_assert (strcmp (data, "bar=baz") == 0 && "g_getenv() doesn't support '=' in values");
-  
+
+#if 0  
+  /* We can't test this, because it's an illegal argument that
+   * we g_return_if_fail for. Plus how would we check for failure,
+   * since we can't set the value...
+   */
   g_unsetenv ("foo=bar");
-  data = g_getenv ("foo");
-  g_assert (data != NULL && "g_unsetenv() accepts '=' in names");
+#endif  
   g_unsetenv ("foo");
   data = g_getenv ("foo");
   g_assert (data == NULL && "g_unsetenv() doesn't support '=' in values");