[PATCH libinput 2/4] test: restore log priority after each test
Peter Hutterer
peter.hutterer at who-t.net
Sat May 24 02:44:57 PDT 2014
On 23/05/2014 17:11 , Hans de Goede wrote:
> Hi,
>
> On 05/23/2014 06:37 AM, Peter Hutterer wrote:
>> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>> ---
>> test/log.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/test/log.c b/test/log.c
>> index 0c5508f..b8cc767 100644
>> --- a/test/log.c
>> +++ b/test/log.c
>> @@ -74,6 +74,7 @@ END_TEST
>> START_TEST(log_handler_invoked)
>> {
>> struct libinput *li;
>> + enum libinput_log_priority pri = libinput_log_get_priority();
>>
>> libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
>> libinput_log_set_handler(simple_log_handler, NULL);
>> @@ -86,12 +87,14 @@ START_TEST(log_handler_invoked)
>> log_handler_called = 0;
>>
>> libinput_destroy(li);
>> + libinput_log_set_priority(pri);
>> }
>> END_TEST
>>
>> START_TEST(log_userdata_NULL)
>> {
>> struct libinput *li;
>> + enum libinput_log_priority pri = libinput_log_get_priority();
>>
>> libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
>> libinput_log_set_handler(simple_log_handler, NULL);
>> @@ -104,12 +107,16 @@ START_TEST(log_userdata_NULL)
>> log_handler_called = 0;
>>
>> libinput_destroy(li);
>> +
>> + libinput_log_set_priority(pri);
>> + libinput_log_set_priority(pri);
>
>
> Restoring the log priority twice here seems excessive :)
you can never be too sure :)
thanks
Cheers,
Peter
>
> With this fixed, the entire series is:
>
> Reviewed-by: Hans de Goede <hdegoede at redhat.com>
>
> Regards,
>
> Hans
>
>
>> }
>> END_TEST
>>
>> START_TEST(log_userdata)
>> {
>> struct libinput *li;
>> + enum libinput_log_priority pri = libinput_log_get_priority();
>>
>> libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
>> libinput_log_set_handler(simple_log_handler, &li);
>> @@ -122,12 +129,14 @@ START_TEST(log_userdata)
>> log_handler_called = 0;
>>
>> libinput_destroy(li);
>> + libinput_log_set_priority(pri);
>> }
>> END_TEST
>>
>> START_TEST(log_handler_NULL)
>> {
>> struct libinput *li;
>> + enum libinput_log_priority pri = libinput_log_get_priority();
>>
>> libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
>> libinput_log_set_handler(NULL, NULL);
>> @@ -141,12 +150,14 @@ START_TEST(log_handler_NULL)
>> libinput_log_set_handler(simple_log_handler, NULL);
>>
>> libinput_destroy(li);
>> + libinput_log_set_priority(pri);
>> }
>> END_TEST
>>
>> START_TEST(log_priority)
>> {
>> struct libinput *li;
>> + enum libinput_log_priority pri = libinput_log_get_priority();
>>
>> libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_ERROR);
>> libinput_log_set_handler(simple_log_handler, NULL);
>> @@ -164,6 +175,7 @@ START_TEST(log_priority)
>> log_handler_called = 0;
>>
>> libinput_destroy(li);
>> + libinput_log_set_priority(pri);
>> }
>> END_TEST
>>
>>
More information about the wayland-devel
mailing list