Added support for network interface model setting

This commit is contained in:
Daniel P. Berrange
2008-04-30 12:30:55 +00:00
parent 303277a8dc
commit 159cb2b97c
20 changed files with 251 additions and 17 deletions

View File

@@ -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 */