[libvirt] [PATCHv2 2/1] tests: add helper to determine when to skip expensive tests

Eric Blake eblake at redhat.com
Mon Aug 12 14:24:52 UTC 2013


On 08/12/2013 05:54 AM, Peter Krempa wrote:
> On 08/02/13 23:47, Eric Blake wrote:
>> The logic set up in previous patch for exposing VIR_TEST_EXPENSIVE
>> to individual tests is as follows:
>>

>> +++ b/tests/testutils.c
>> @@ -66,6 +66,7 @@
>>
>>   static unsigned int testDebug = -1;
>>   static unsigned int testVerbose = -1;
>> +static unsigned int testExpensive = -1;
> 
> Pre-existing, but initializing unsigneds to -1 is really awkward ...

It's shorthand for initializing to UINT_MAX.

> 
>>
>>   static unsigned int testOOM = 0;
>>   static size_t testCounter = 0;
>> @@ -581,6 +582,13 @@ virTestGetVerbose(void) {
>>       return testVerbose || virTestGetDebug();
>>   }
>>
>> +unsigned int
> 
> A boolean would be enough given the return values of virTestGetFlag and
> the expected results.

For virTestGetFlag, we generally only care about 0 or 1; but since it
uses the same helper function of virTestGetFlag, which DOES care about
the numeric value (ie. VIR_TEST_DEBUG=2 gives more output than
VIR_TEST_DEBUG=1), that explains why the helper function returns an
integer, and why I copied that paradigm.

> 
> ACK anyways, my comments are pointing out stuff that was pre-existing.

Thanks for the review; I'll push shortly as-is; I'm not sure it's worth
changing the types of these functions.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130812/e5c94aa9/attachment-0001.sig>


More information about the libvir-list mailing list