diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2008-04-30 12:30:55 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2008-04-30 12:30:55 +0000 |
commit | 159cb2b97c48902b0deabe2f85491a46507b1a2e (patch) | |
tree | 8dac2b771d76e82badadd0fdc824756877560df4 /tests/testutils.c | |
parent | * gnulib/lib/stdio-impl.h: Add another new file from gnulib. (diff) | |
download | libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.tar.gz libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.tar.bz2 libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.zip |
Added support for network interface model setting
Diffstat (limited to 'tests/testutils.c')
-rw-r--r-- | tests/testutils.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/testutils.c b/tests/testutils.c index 56f45fbc9..ea2c59f0e 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -23,6 +23,7 @@ #include <fcntl.h> #include <limits.h> #include "testutils.h" +#include "internal.h" #ifdef HAVE_PATHS_H #include <paths.h> @@ -231,23 +232,27 @@ int virtTestDifference(FILE *stream, const char *expectEnd = expect + (strlen(expect)-1); const char *actualStart = actual; const char *actualEnd = actual + (strlen(actual)-1); + const char *debug; - if (getenv("DEBUG_TESTS") == NULL) + if ((debug = getenv("DEBUG_TESTS")) == NULL) return 0; - /* Skip to first character where they differ */ - while (*expectStart && *actualStart && - *actualStart == *expectStart) { - actualStart++; - expectStart++; - } + if (STREQ(debug, "") || + STREQ(debug, "1")) { + /* Skip to first character where they differ */ + while (*expectStart && *actualStart && + *actualStart == *expectStart) { + actualStart++; + expectStart++; + } - /* Work backwards to last character where they differ */ - while (actualEnd > actualStart && - expectEnd > expectStart && - *actualEnd == *expectEnd) { - actualEnd--; - expectEnd--; + /* Work backwards to last character where they differ */ + while (actualEnd > actualStart && + expectEnd > expectStart && + *actualEnd == *expectEnd) { + actualEnd--; + expectEnd--; + } } /* Show the trimmed differences */ |