avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bru...@apache.org
Subject svn commit: r1057728 [2/2] - in /avro/trunk: ./ lang/c/jansson/ lang/c/jansson/doc/ lang/c/jansson/doc/ext/ lang/c/jansson/src/ lang/c/jansson/test/ lang/c/jansson/test/bin/ lang/c/jansson/test/scripts/ lang/c/jansson/test/testdata/ lang/c/jansson/test...
Date Tue, 11 Jan 2011 16:53:57 GMT
Modified: avro/trunk/lang/c/jansson/src/value.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/src/value.c?rev=1057728&r1=1057727&r2=1057728&view=diff
==============================================================================
--- avro/trunk/lang/c/jansson/src/value.c (original)
+++ avro/trunk/lang/c/jansson/src/value.c Tue Jan 11 16:53:53 2011
@@ -1,11 +1,14 @@
 /*
- * Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
+ * Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>
  *
  * Jansson is free software; you can redistribute it and/or modify
  * it under the terms of the MIT license. See LICENSE for details.
  */
 
 #define _GNU_SOURCE
+
+#include <config.h>
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -25,9 +28,16 @@ static inline void json_init(json_t *jso
 
 /*** object ***/
 
-static unsigned int hash_string(const void *key)
+/* This macro just returns a pointer that's a few bytes backwards from
+   string. This makes it possible to pass a pointer to object_key_t
+   when only the string inside it is used, without actually creating
+   an object_key_t instance. */
+#define string_to_key(string)  container_of(string, object_key_t, key)
+
+static unsigned int hash_key(const void *ptr)
 {
-    const char *str = (const char *)key;
+    const char *str = ((const object_key_t *)ptr)->key;
+
     unsigned int hash = 5381;
     unsigned int c;
 
@@ -40,9 +50,10 @@ static unsigned int hash_string(const vo
     return hash;
 }
 
-static int string_equal(const void *key1, const void *key2)
+static int key_equal(const void *ptr1, const void *ptr2)
 {
-    return strcmp((const char *)key1, (const char *)key2) == 0;
+    return strcmp(((const object_key_t *)ptr1)->key,
+                  ((const object_key_t *)ptr2)->key) == 0;
 }
 
 static void value_decref(void *value)
@@ -57,13 +68,14 @@ json_t *json_object(void)
         return NULL;
     json_init(&object->json, JSON_OBJECT);
 
-    if(hashtable_init(&object->hashtable, hash_string, string_equal,
+    if(hashtable_init(&object->hashtable, hash_key, key_equal,
                       free, value_decref))
     {
         free(object);
         return NULL;
     }
 
+    object->serial = 0;
     object->visited = 0;
 
     return &object->json;
@@ -94,12 +106,13 @@ json_t *json_object_get(const json_t *js
         return NULL;
 
     object = json_to_object(json);
-    return hashtable_get(&object->hashtable, key);
+    return hashtable_get(&object->hashtable, string_to_key(key));
 }
 
 int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value)
 {
     json_object_t *object;
+    object_key_t *k;
 
     if(!key || !value)
         return -1;
@@ -111,7 +124,14 @@ int json_object_set_new_nocheck(json_t *
     }
     object = json_to_object(json);
 
-    if(hashtable_set(&object->hashtable, strdup(key), value))
+    k = malloc(sizeof(object_key_t) + strlen(key) + 1);
+    if(!k)
+        return -1;
+
+    k->serial = object->serial++;
+    strcpy(k->key, key);
+
+    if(hashtable_set(&object->hashtable, k, value))
     {
         json_decref(value);
         return -1;
@@ -120,11 +140,6 @@ int json_object_set_new_nocheck(json_t *
     return 0;
 }
 
-int json_object_set_nocheck(json_t *json, const char *key, json_t *value)
-{
-    return json_object_set_new_nocheck(json, key, json_incref(value));
-}
-
 int json_object_set_new(json_t *json, const char *key, json_t *value)
 {
     if(!key || !utf8_check_string(key, -1))
@@ -144,7 +159,7 @@ int json_object_del(json_t *json, const 
         return -1;
 
     object = json_to_object(json);
-    return hashtable_del(&object->hashtable, key);
+    return hashtable_del(&object->hashtable, string_to_key(key));
 }
 
 int json_object_clear(json_t *json)
@@ -175,7 +190,7 @@ int json_object_update(json_t *object, j
         key = json_object_iter_key(iter);
         value = json_object_iter_value(iter);
 
-        if(json_object_set(object, key, value))
+        if(json_object_set_nocheck(object, key, value))
             return -1;
 
         iter = json_object_iter_next(other, iter);
@@ -195,6 +210,17 @@ void *json_object_iter(json_t *json)
     return hashtable_iter(&object->hashtable);
 }
 
+void *json_object_iter_at(json_t *json, const char *key)
+{
+    json_object_t *object;
+
+    if(!key || !json_is_object(json))
+        return NULL;
+
+    object = json_to_object(json);
+    return hashtable_iter_at(&object->hashtable, string_to_key(key));
+}
+
 void *json_object_iter_next(json_t *json, void *iter)
 {
     json_object_t *object;
@@ -206,12 +232,20 @@ void *json_object_iter_next(json_t *json
     return hashtable_iter_next(&object->hashtable, iter);
 }
 
+const object_key_t *jsonp_object_iter_fullkey(void *iter)
+{
+    if(!iter)
+        return NULL;
+
+    return hashtable_iter_key(iter);
+}
+
 const char *json_object_iter_key(void *iter)
 {
     if(!iter)
         return NULL;
 
-    return (const char *)hashtable_iter_key(iter);
+    return jsonp_object_iter_fullkey(iter)->key;
 }
 
 json_t *json_object_iter_value(void *iter)
@@ -222,6 +256,95 @@ json_t *json_object_iter_value(void *ite
     return (json_t *)hashtable_iter_value(iter);
 }
 
+int json_object_iter_set_new(json_t *json, void *iter, json_t *value)
+{
+    json_object_t *object;
+
+    if(!json_is_object(json) || !iter || !value)
+        return -1;
+
+    object = json_to_object(json);
+    hashtable_iter_set(&object->hashtable, iter, value);
+
+    return 0;
+}
+
+static int json_object_equal(json_t *object1, json_t *object2)
+{
+    void *iter;
+
+    if(json_object_size(object1) != json_object_size(object2))
+        return 0;
+
+    iter = json_object_iter(object1);
+    while(iter)
+    {
+        const char *key;
+        json_t *value1, *value2;
+
+        key = json_object_iter_key(iter);
+        value1 = json_object_iter_value(iter);
+        value2 = json_object_get(object2, key);
+
+        if(!json_equal(value1, value2))
+            return 0;
+
+        iter = json_object_iter_next(object1, iter);
+    }
+
+    return 1;
+}
+
+static json_t *json_object_copy(json_t *object)
+{
+    json_t *result;
+    void *iter;
+
+    result = json_object();
+    if(!result)
+        return NULL;
+
+    iter = json_object_iter(object);
+    while(iter)
+    {
+        const char *key;
+        json_t *value;
+
+        key = json_object_iter_key(iter);
+        value = json_object_iter_value(iter);
+        json_object_set_nocheck(result, key, value);
+
+        iter = json_object_iter_next(object, iter);
+    }
+
+    return result;
+}
+
+static json_t *json_object_deep_copy(json_t *object)
+{
+    json_t *result;
+    void *iter;
+
+    result = json_object();
+    if(!result)
+        return NULL;
+
+    iter = json_object_iter(object);
+    while(iter)
+    {
+        const char *key;
+        json_t *value;
+
+        key = json_object_iter_key(iter);
+        value = json_object_iter_value(iter);
+        json_object_set_new_nocheck(result, key, json_deep_copy(value));
+
+        iter = json_object_iter_next(object, iter);
+    }
+
+    return result;
+}
+
 
 /*** array ***/
 
@@ -468,6 +591,57 @@ int json_array_extend(json_t *json, json
     return 0;
 }
 
+static int json_array_equal(json_t *array1, json_t *array2)
+{
+    unsigned int i, size;
+
+    size = json_array_size(array1);
+    if(size != json_array_size(array2))
+        return 0;
+
+    for(i = 0; i < size; i++)
+    {
+        json_t *value1, *value2;
+
+        value1 = json_array_get(array1, i);
+        value2 = json_array_get(array2, i);
+
+        if(!json_equal(value1, value2))
+            return 0;
+    }
+
+    return 1;
+}
+
+static json_t *json_array_copy(json_t *array)
+{
+    json_t *result;
+    unsigned int i;
+
+    result = json_array();
+    if(!result)
+        return NULL;
+
+    for(i = 0; i < json_array_size(array); i++)
+        json_array_append(result, json_array_get(array, i));
+
+    return result;
+}
+
+static json_t *json_array_deep_copy(json_t *array)
+{
+    json_t *result;
+    unsigned int i;
+
+    result = json_array();
+    if(!result)
+        return NULL;
+
+    for(i = 0; i < json_array_size(array); i++)
+        json_array_append_new(result, json_deep_copy(json_array_get(array, i)));
+
+    return result;
+}
 
 /*** string ***/
 
@@ -508,14 +682,11 @@ const char *json_string_value(const json
     return json_to_string(json)->value;
 }
 
-int json_string_set(const json_t *json, const char *value)
+int json_string_set_nocheck(json_t *json, const char *value)
 {
     char *dup;
     json_string_t *string;
 
-    if(!json_is_string(json) || !value || !utf8_check_string(value, -1))
-        return -1;
-
     dup = strdup(value);
     if(!dup)
         return -1;
@@ -527,12 +698,30 @@ int json_string_set(const json_t *json, 
     return 0;
 }
 
+int json_string_set(json_t *json, const char *value)
+{
+    if(!value || !utf8_check_string(value, -1))
+        return -1;
+
+    return json_string_set_nocheck(json, value);
+}
+
 static void json_delete_string(json_string_t *string)
 {
     free(string->value);
     free(string);
 }
 
+static int json_string_equal(json_t *string1, json_t *string2)
+{
+    return strcmp(json_string_value(string1), json_string_value(string2)) == 0;
+}
+
+static json_t *json_string_copy(json_t *string)
+{
+    return json_string_nocheck(json_string_value(string));
+}
+
 
 /*** integer ***/
 
@@ -555,7 +744,7 @@ int json_integer_value(const json_t *jso
     return json_to_integer(json)->value;
 }
 
-int json_integer_set(const json_t *json, int value)
+int json_integer_set(json_t *json, int value)
 {
     if(!json_is_integer(json))
         return -1;
@@ -570,6 +759,16 @@ static void json_delete_integer(json_int
     free(integer);
 }
 
+static int json_integer_equal(json_t *integer1, json_t *integer2)
+{
+    return json_integer_value(integer1) == json_integer_value(integer2);
+}
+
+static json_t *json_integer_copy(json_t *integer)
+{
+    return json_integer(json_integer_value(integer));
+}
+
 
 /*** real ***/
 
@@ -592,7 +791,7 @@ double json_real_value(const json_t *jso
     return json_to_real(json)->value;
 }
 
-int json_real_set(const json_t *json, double value)
+int json_real_set(json_t *json, double value)
 {
     if(!json_is_real(json))
         return 0;
@@ -607,6 +806,16 @@ static void json_delete_real(json_real_t
     free(real);
 }
 
+static int json_real_equal(json_t *real1, json_t *real2)
+{
+    return json_real_value(real1) == json_real_value(real2);
+}
+
+static json_t *json_real_copy(json_t *real)
+{
+    return json_real(json_real_value(real));
+}
+
 
 /*** number ***/
 
@@ -627,7 +836,7 @@ json_t *json_true(void)
 {
     static json_t the_true = {
         .type = JSON_TRUE,
-        .refcount = (unsigned int)1
+        .refcount = (unsigned int)-1
     };
     return &the_true;
 }
@@ -637,7 +846,7 @@ json_t *json_false(void)
 {
     static json_t the_false = {
         .type = JSON_FALSE,
-        .refcount = (unsigned int)1
+        .refcount = (unsigned int)-1
     };
     return &the_false;
 }
@@ -647,7 +856,7 @@ json_t *json_null(void)
 {
     static json_t the_null = {
         .type = JSON_NULL,
-        .refcount = (unsigned int)1
+        .refcount = (unsigned int)-1
     };
     return &the_null;
 }
@@ -674,3 +883,94 @@ void json_delete(json_t *json)
 
     /* json_delete is not called for true, false or null */
 }
+
+
+/*** equality ***/
+
+int json_equal(json_t *json1, json_t *json2)
+{
+    if(!json1 || !json2)
+        return 0;
+
+    if(json_typeof(json1) != json_typeof(json2))
+        return 0;
+
+    /* this covers true, false and null as they are singletons */
+    if(json1 == json2)
+        return 1;
+
+    if(json_is_object(json1))
+        return json_object_equal(json1, json2);
+
+    if(json_is_array(json1))
+        return json_array_equal(json1, json2);
+
+    if(json_is_string(json1))
+        return json_string_equal(json1, json2);
+
+    if(json_is_integer(json1))
+        return json_integer_equal(json1, json2);
+
+    if(json_is_real(json1))
+        return json_real_equal(json1, json2);
+
+    return 0;
+}
+
+
+/*** copying ***/
+
+json_t *json_copy(json_t *json)
+{
+    if(!json)
+        return NULL;
+
+    if(json_is_object(json))
+        return json_object_copy(json);
+
+    if(json_is_array(json))
+        return json_array_copy(json);
+
+    if(json_is_string(json))
+        return json_string_copy(json);
+
+    if(json_is_integer(json))
+        return json_integer_copy(json);
+
+    if(json_is_real(json))
+        return json_real_copy(json);
+
+    if(json_is_true(json) || json_is_false(json) || json_is_null(json))
+        return json;
+
+    return NULL;
+}
+
+json_t *json_deep_copy(json_t *json)
+{
+    if(!json)
+        return NULL;
+
+    if(json_is_object(json))
+        return json_object_deep_copy(json);
+
+    if(json_is_array(json))
+        return json_array_deep_copy(json);
+
+    /* for the rest of the types, deep copying doesn't differ from
+       shallow copying */
+
+    if(json_is_string(json))
+        return json_string_copy(json);
+
+    if(json_is_integer(json))
+        return json_integer_copy(json);
+
+    if(json_is_real(json))
+        return json_real_copy(json);
+
+    if(json_is_true(json) || json_is_false(json) || json_is_null(json))
+        return json;
+
+    return NULL;
+}

Modified: avro/trunk/lang/c/jansson/test/Makefile.am
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/Makefile.am?rev=1057728&r1=1057727&r2=1057728&view=diff
==============================================================================
--- avro/trunk/lang/c/jansson/test/Makefile.am (original)
+++ avro/trunk/lang/c/jansson/test/Makefile.am Tue Jan 11 16:53:53 2011
@@ -1,22 +1,10 @@
-DIST_SUBDIRS = testprogs testdata
-SUBDIRS = testprogs
+SUBDIRS = bin suites
+EXTRA_DIST = scripts run-suites
 
-check_PROGRAMS = loadf_dumpf loads_dumps load_file_dump_file
-
-AM_CPPFLAGS = -I$(top_srcdir)/src
-AM_CFLAGS = -Wall -Werror
-LDFLAGS = -static  # for speed and Valgrind
-LDADD = ../src/libjansson.la
-
-TESTS = test-api test-invalid test-valid
-
-EXTRA_DIST = \
-	test-api \
-	test-invalid \
-	test-valid \
-	run-test \
-	json-compare.py \
-	split-testfile.py
+TESTS = run-suites
+TESTS_ENVIRONMENT = \
+	top_srcdir=$(top_srcdir) \
+	top_builddir=$(top_builddir)
 
 clean-local:
-	rm -rf testlogs
+	rm -rf logs

Added: avro/trunk/lang/c/jansson/test/bin/Makefile.am
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/bin/Makefile.am?rev=1057728&view=auto
==============================================================================
--- avro/trunk/lang/c/jansson/test/bin/Makefile.am (added)
+++ avro/trunk/lang/c/jansson/test/bin/Makefile.am Tue Jan 11 16:53:53 2011
@@ -0,0 +1,6 @@
+check_PROGRAMS = json_process
+
+AM_CPPFLAGS = -I$(top_srcdir)/src
+AM_CFLAGS = -Wall -Werror
+LDFLAGS = -static  # for speed and Valgrind
+LDADD = $(top_builddir)/src/libjansson.la

Added: avro/trunk/lang/c/jansson/test/bin/json_process.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/bin/json_process.c?rev=1057728&view=auto
==============================================================================
--- avro/trunk/lang/c/jansson/test/bin/json_process.c (added)
+++ avro/trunk/lang/c/jansson/test/bin/json_process.c Tue Jan 11 16:53:53 2011
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>
+ *
+ * Jansson is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See LICENSE for details.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <jansson.h>
+
+static int getenv_int(const char *name)
+{
+    char *value, *end;
+    long result;
+
+    value = getenv(name);
+    if(!value)
+        return 0;
+
+    result = strtol(value, &end, 10);
+    if(*end != '\0')
+        return 0;
+
+    return (int)result;
+}
+
+int main(int argc, char *argv[])
+{
+    int indent = 0;
+    unsigned int flags = 0;
+
+    json_t *json;
+    json_error_t error;
+
+    if(argc != 1) {
+        fprintf(stderr, "usage: %s\n", argv[0]);
+        return 2;
+    }
+
+    indent = getenv_int("JSON_INDENT");
+    if(indent < 0 || indent > 255) {
+        fprintf(stderr, "invalid value for JSON_INDENT: %d\n", indent);
+        return 2;
+    }
+
+    if(indent > 0)
+        flags |= JSON_INDENT(indent);
+
+    if(getenv_int("JSON_COMPACT") > 0)
+        flags |= JSON_COMPACT;
+
+    if(getenv_int("JSON_ENSURE_ASCII"))
+        flags |= JSON_ENSURE_ASCII;
+
+    if(getenv_int("JSON_PRESERVE_ORDER"))
+        flags |= JSON_PRESERVE_ORDER;
+
+    if(getenv_int("JSON_SORT_KEYS"))
+        flags |= JSON_SORT_KEYS;
+
+    json = json_loadf(stdin, &error);
+    if(!json) {
+        fprintf(stderr, "%d\n%s\n", error.line, error.text);
+        return 1;
+    }
+
+    json_dumpf(json, stdout, flags);
+    json_decref(json);
+
+    return 0;
+}

Added: avro/trunk/lang/c/jansson/test/run-suites
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/run-suites?rev=1057728&view=auto
==============================================================================
--- avro/trunk/lang/c/jansson/test/run-suites (added)
+++ avro/trunk/lang/c/jansson/test/run-suites Tue Jan 11 16:53:53 2011
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+while [ -n "$1" ]; do
+    suite=$1
+    if [ -x $top_srcdir/test/suites/$suite/run ]; then
+        SUITES="$SUITES $suite"
+    else
+        echo "No such suite: $suite"
+        exit 1
+    fi
+    shift
+done
+
+if [ -z "$SUITES" ]; then
+    suitedirs=$top_srcdir/test/suites/*
+    for suitedir in $suitedirs; do
+        if [ -d $suitedir ]; then
+            SUITES="$SUITES `basename $suitedir`"
+        fi
+    done
+fi
+
+export suites_srcdir=$top_srcdir/test/suites
+export suites_builddir=suites
+export scriptdir=$top_srcdir/test/scripts
+export logdir=logs
+export bindir=bin
+
+passed=0
+failed=0
+for suite in $SUITES; do
+    echo "Suite: $suite"
+    if $suites_srcdir/$suite/run $suite; then
+        passed=$(($passed+1))
+    else
+        failed=$(($failed+1))
+    fi
+done
+
+if [ $failed -gt 0 ]; then
+    echo "$failed of $((passed+failed)) test suites failed"
+    exit 1
+else
+    echo "$passed test suites passed"
+    rm -rf $logdir
+fi

Added: avro/trunk/lang/c/jansson/test/scripts/run-tests.sh
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/scripts/run-tests.sh?rev=1057728&view=auto
==============================================================================
--- avro/trunk/lang/c/jansson/test/scripts/run-tests.sh (added)
+++ avro/trunk/lang/c/jansson/test/scripts/run-tests.sh Tue Jan 11 16:53:53 2011
@@ -0,0 +1,71 @@
+# Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>
+#
+# Jansson is free software; you can redistribute it and/or modify
+# it under the terms of the MIT license. See LICENSE for details.
+
+json_process=$bindir/json_process
+
+suite_name=$1
+suite_srcdir=$suites_srcdir/$suite_name
+suite_builddir=$suites_builddir/$suite_name
+suite_log=$logdir/$suite_name
+
+
+[ -z "$VERBOSE" ] && VERBOSE=0
+
+. $scriptdir/valgrind.sh
+
+rm -rf $suite_log
+mkdir -p $suite_log
+
+for test_path in $suite_srcdir/*; do
+    test_name=$(basename $test_path)
+    test_builddir=$suite_builddir/$test_name
+    test_log=$suite_log/$test_name
+
+    [ "$test_name" = "run" ] && continue
+    is_test || continue
+
+    rm -rf $test_log
+    mkdir -p $test_log
+    if [ $VERBOSE -eq 1 ]; then
+        echo -n "$test_name... "
+    fi
+
+    if run_test; then
+        # Success
+        if [ $VERBOSE -eq 1 ]; then
+            echo "ok"
+        else
+            echo -n "."
+        fi
+        rm -rf $test_log
+    else
+        # Failure
+        if [ $VERBOSE -eq 1 ]; then
+            echo "FAILED"
+        else
+            echo -n "F"
+        fi
+    fi
+done
+
+if [ $VERBOSE -eq 0 ]; then
+    echo
+fi
+
+if [ -n "$(ls -A $suite_log)" ]; then
+    for test_log in $suite_log/*; do
+        test_name=$(basename $test_log)
+        test_path=$suite_srcdir/$test_name
+        echo "================================================================="
+        echo "$suite_name/$test_name"
+        echo "================================================================="
+        show_error
+        echo
+    done
+    echo "================================================================="
+    exit 1
+else
+    rm -rf $suite_log
+fi

Added: avro/trunk/lang/c/jansson/test/scripts/valgrind.sh
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/jansson/test/scripts/valgrind.sh?rev=1057728&view=auto
==============================================================================
--- avro/trunk/lang/c/jansson/test/scripts/valgrind.sh (added)
+++ avro/trunk/lang/c/jansson/test/scripts/valgrind.sh Tue Jan 11 16:53:53 2011
@@ -0,0 +1,35 @@
+# Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>
+#
+# Jansson is free software; you can redistribute it and/or modify
+# it under the terms of the MIT license. See LICENSE for details.
+
+[ -z "$VALGRIND" ] && VALGRIND=0
+
+VALGRIND_CMDLINE="valgrind --leak-check=full --show-reachable=yes --track-origins=yes -q"
+
+if [ $VALGRIND -eq 1 ]; then
+    test_runner="$VALGRIND_CMDLINE"
+    json_process="$VALGRIND_CMDLINE $json_process"
+else
+    test_runner=""
+fi
+
+valgrind_check() {
+    if [ $VALGRIND -eq 1 ]; then
+        # Check for Valgrind error output. The valgrind option
+        # --error-exitcode is not enough because Valgrind doesn't
+        # think unfreed allocs are errors.
+        if grep -E -q '^==[0-9]+== ' $1; then
+            touch $test_log/valgrind_error
+            return 1
+        fi
+    fi
+}
+
+valgrind_show_error() {
+    if [ $VALGRIND -eq 1 -a -f $test_log/valgrind_error ]; then
+        echo "valgrind detected an error"
+        return 0
+    fi
+    return 1
+}



Mime
View raw message