mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: compilation updates
This commit is contained in:
parent
325ca748bb
commit
c8dda31466
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
v = lvm_lv_get_property(lv, "snap_percent");
|
v = lvm_lv_get_property(lv, "snap_percent");
|
||||||
assert(v.is_valid);
|
assert(v.is_valid);
|
||||||
assert(v.value.integer == PERCENT_INVALID);
|
assert(v.value.integer == (uint64_t) PERCENT_INVALID);
|
||||||
|
|
||||||
v = lvm_lv_get_property(lv, "origin");
|
v = lvm_lv_get_property(lv, "origin");
|
||||||
assert(v.is_valid);
|
assert(v.is_valid);
|
||||||
|
@ -41,7 +41,7 @@ struct stats {
|
|||||||
static struct stats s;
|
static struct stats s;
|
||||||
|
|
||||||
static char *readbuf = NULL;
|
static char *readbuf = NULL;
|
||||||
static int readbuf_sz = 0, readbuf_used = 0;
|
static size_t readbuf_sz = 0, readbuf_used = 0;
|
||||||
|
|
||||||
static int die = 0;
|
static int die = 0;
|
||||||
static int verbose = 0; /* >1 with timestamps */
|
static int verbose = 0; /* >1 with timestamps */
|
||||||
@ -57,11 +57,14 @@ struct subst {
|
|||||||
|
|
||||||
static struct subst subst[2];
|
static struct subst subst[2];
|
||||||
|
|
||||||
#define PASSED 0
|
enum {
|
||||||
#define SKIPPED 1
|
UNKNOWN,
|
||||||
#define FAILED 2
|
PASSED,
|
||||||
#define WARNED 3
|
SKIPPED,
|
||||||
#define KNOWNFAIL 4
|
FAILED,
|
||||||
|
WARNED,
|
||||||
|
KNOWNFAIL,
|
||||||
|
};
|
||||||
|
|
||||||
static void handler( int sig ) {
|
static void handler( int sig ) {
|
||||||
signal( sig, SIG_DFL );
|
signal( sig, SIG_DFL );
|
||||||
@ -121,18 +124,18 @@ static int outline(FILE *out, char *buf, int start, int force) {
|
|||||||
static void dump(void) {
|
static void dump(void) {
|
||||||
int counter_last = -1, counter = 0;
|
int counter_last = -1, counter = 0;
|
||||||
|
|
||||||
while ( counter < readbuf_used && counter != counter_last ) {
|
while ((counter < (int) readbuf_used) && (counter != counter_last)) {
|
||||||
counter_last = counter;
|
counter_last = counter;
|
||||||
counter = outline( stdout, readbuf, counter, 1 );
|
counter = outline( stdout, readbuf, counter, 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trickle(FILE *out, int *last, int *counter) {
|
static void trickle(FILE *out, int *last, int *counter) {
|
||||||
if (*last > readbuf_used) {
|
if (*last > (int) readbuf_used) {
|
||||||
*last = -1;
|
*last = -1;
|
||||||
*counter = 0;
|
*counter = 0;
|
||||||
}
|
}
|
||||||
while ( *counter < readbuf_used && *counter != *last ) {
|
while ((*counter < (int) readbuf_used) && (*counter != *last)) {
|
||||||
*last = *counter;
|
*last = *counter;
|
||||||
*counter = outline( out, readbuf, *counter, 1 );
|
*counter = outline( out, readbuf, *counter, 1 );
|
||||||
}
|
}
|
||||||
@ -281,6 +284,8 @@ static void failed(int i, char *f, int st) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void run(int i, char *f) {
|
static void run(int i, char *f) {
|
||||||
|
char flavour[512], script[512];
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
perror("Fork failed.");
|
perror("Fork failed.");
|
||||||
@ -293,7 +298,6 @@ static void run(int i, char *f) {
|
|||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
}
|
}
|
||||||
char flavour[512], script[512];
|
|
||||||
if (strchr(f, ':')) {
|
if (strchr(f, ':')) {
|
||||||
strcpy(flavour, f);
|
strcpy(flavour, f);
|
||||||
*strchr(flavour, ':') = 0;
|
*strchr(flavour, ':') = 0;
|
||||||
@ -426,6 +430,7 @@ int main(int argc, char **argv) {
|
|||||||
case SKIPPED:
|
case SKIPPED:
|
||||||
printf("skipped: %s\n", argv[i]);
|
printf("skipped: %s\n", argv[i]);
|
||||||
break;
|
break;
|
||||||
|
default: /* do nothing */ ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user