mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
cov: better defined constructors
Ensure C++ initializes all struct members. Also some deterministic buffer initialization.
This commit is contained in:
parent
ebd150366f
commit
d5c82b0e73
@ -755,7 +755,7 @@ struct TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void pipe() {
|
void pipe() {
|
||||||
int fds[2];
|
int fds[2] = { 0 };
|
||||||
|
|
||||||
if (socketpair( PF_UNIX, SOCK_STREAM, 0, fds )) {
|
if (socketpair( PF_UNIX, SOCK_STREAM, 0, fds )) {
|
||||||
perror("socketpair");
|
perror("socketpair");
|
||||||
@ -981,7 +981,9 @@ struct TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TestCase( Journal &j, Options opt, std::string path, std::string _name, std::string _flavour )
|
TestCase( Journal &j, Options opt, std::string path, std::string _name, std::string _flavour )
|
||||||
: child( path ), name( _name ), flavour( _flavour ), timeout( false ),
|
: child( path ), name( _name ), flavour( _flavour ),
|
||||||
|
iobuf( NULL ), usage( { 0 } ), status( 0 ), timeout( false ),
|
||||||
|
pid( 0 ), start( 0 ), end( 0 ), silent_start( 0 ),
|
||||||
last_update( 0 ), last_heartbeat( 0 ), options( opt ), journal( &j )
|
last_update( 0 ), last_heartbeat( 0 ), options( opt ), journal( &j )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -1085,7 +1087,7 @@ struct Main {
|
|||||||
return journal.count( Journal::FAILED ) || journal.count( Journal::TIMEOUT ) ? 1 : 0;
|
return journal.count( Journal::FAILED ) || journal.count( Journal::TIMEOUT ) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Main( Options o ) : die( false ), journal( o.outdir ), options( o ) {}
|
Main( Options o ) : die( false ), start( 0 ), journal( o.outdir ), options( o ) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -52,9 +52,10 @@ static void *_fix_init(struct io_engine *engine)
|
|||||||
uint8_t buffer[T_BLOCK_SIZE];
|
uint8_t buffer[T_BLOCK_SIZE];
|
||||||
struct fixture *f = malloc(sizeof(*f));
|
struct fixture *f = malloc(sizeof(*f));
|
||||||
unsigned b, i;
|
unsigned b, i;
|
||||||
struct statvfs fsdata;
|
struct statvfs fsdata = { 0 };
|
||||||
static int _runs_is_tmpfs = -1;
|
static int _runs_is_tmpfs = -1;
|
||||||
|
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
if (_runs_is_tmpfs == -1) {
|
if (_runs_is_tmpfs == -1) {
|
||||||
// With testing in tmpfs directory O_DIRECT cannot be used
|
// With testing in tmpfs directory O_DIRECT cannot be used
|
||||||
// tmpfs has f_fsid == 0 (unsure if this is best guess)
|
// tmpfs has f_fsid == 0 (unsure if this is best guess)
|
||||||
|
@ -271,6 +271,7 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "out of memory\n");
|
fprintf(stderr, "out of memory\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
memset(t_array, 0, sizeof(*t_array) * nr_tests);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
dm_list_iterate_items (ts, &suites)
|
dm_list_iterate_items (ts, &suites)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user