Looking quite nice. However one thing that is a bit concerning is that the tests duplicate a lot of code in the dbus and non-dbus cases. Would it be possible to consolidate these so that every test is run with common code. So something along the lines of this:
void testImplementation(MediaStore &writer, MediaStore &queryer) {
// First set up
writer.insert(whatevs);
// Then query
ASSERT_EQ(queryer.query("..."), result);
}
And then have the actual dbus and non-dbus test cases just do basically this:
Looking quite nice. However one thing that is a bit concerning is that the tests duplicate a lot of code in the dbus and non-dbus cases. Would it be possible to consolidate these so that every test is run with common code. So something along the lines of this:
void testImplementat ion(MediaStore &writer, MediaStore &queryer) { insert( whatevs) ;
// First set up
writer.
// Then query EQ(queryer. query(" ..."), result);
ASSERT_
}
And then have the actual dbus and non-dbus test cases just do basically this:
void testWithoutDbus() {
MediaStore local(READWRITE);
testImplement ation(local, local);
}
void testWithDbus() {
MediaStore writer(READWRITE);
MediaStore queryer(READONLY);
testImplement ation(writer, queryer);
}