[SSSD] [PATCH] TESTS: fix segfault in test_sss_strerror_err_last

Pavel Reichl preichl at redhat.com
Thu May 28 15:53:17 UTC 2015



On 05/28/2015 05:45 PM, Lukas Slebodnik wrote:
> On (28/05/15 17:25), Pavel Reichl wrote:
>> Hello,
>>
>> please see simple attached patch. Although test catches the bug and is no
>> doubt useful I believe that we should avoid segfaulting even in tests.
>>
>> Thanks for considering!
> >From a509c49fbc55664170d96e0e29bf6263c8d38a2a Mon Sep 17 00:00:00 2001
>> From: Pavel Reichl <preichl at redhat.com>
>> Date: Thu, 28 May 2015 11:13:47 -0400
>> Subject: [PATCH] TESTS: fix segfault in test_sss_strerror_err_last
>>
>> If there were more error codes than error messages. This
>> test segfaulted.
>>
> When test crashed then it failed.
I don't think that relying on undefined behavior is a good practice.
> So the problem was not in test but in sssd code.
Well technically the test is part of SSSD code suite IMO.
>
> IMHO it's sufficient to test that the last error code is the same.
IMHO it's not good if test is based on occurrence of segfault.
>
> LS
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel




More information about the sssd-devel mailing list