Remove critical log handler; we can't trigger g_return_if_fails() in our

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)
This commit is contained in:
Owen Taylor 2004-03-14 04:27:26 +00:00 committed by Owen Taylor
parent 0b6eeb2eb4
commit db17e65ba3
7 changed files with 66 additions and 15 deletions

View 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

View 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

View 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

View 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

View 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

View 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

View File

@ -43,16 +43,6 @@
#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");