[grilo/mocking: 22/27] net: Don't check GRL_NET_MOCKED for boolean values



commit d2e9d6a0a226240cf981d97d4a60b0f576aadf53
Author: Mathias Hasselmann <mathias openismus com>
Date:   Mon Oct 22 15:21:44 2012 +0200

    net: Don't check GRL_NET_MOCKED for boolean values
    
    It's a pure filename now.

 libs/net/grl-net-mock.c |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/libs/net/grl-net-mock.c b/libs/net/grl-net-mock.c
index 4f85334..db4cc70 100644
--- a/libs/net/grl-net-mock.c
+++ b/libs/net/grl-net-mock.c
@@ -152,21 +152,14 @@ get_content_mocked (GrlNetWc *self,
 void init_mock_requester (GrlNetWc *self)
 {
   char *config_filename = g_strdup (g_getenv (GRL_NET_MOCKED_VAR));
-  base_path = NULL;
-
-  /* Parse environment variable. */
-  enable_mocking = config_filename
-          && strcmp (config_filename, "0")
-          && g_ascii_strcasecmp (config_filename, "no")
-          && g_ascii_strcasecmp (config_filename, "off")
-          && g_ascii_strcasecmp (config_filename, "false");
-
-  if (!enable_mocking) {
-    g_free (config_filename);
-    config_filename = NULL;
-    return;
+
+  if (config_filename == NULL) {
+      enable_mocking = FALSE;
+      return;
   }
 
+  enable_mocking = TRUE;
+
   /* Read configuration file. */
   if (config_filename)
     GRL_DEBUG ("Trying to load mock file \"%s\"", config_filename);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]