[PATCH weston v5 5/6] Converted the config parser test to the new framework.
Jon A. Cruz
jonc at osg.samsung.com
Thu Jul 2 23:11:39 PDT 2015
On 07/02/2015 11:02 PM, Pekka Paalanen wrote:
> On Thu, 02 Jul 2015 18:12:21 -0700
> "Jon A. Cruz" <jonc at osg.samsung.com> wrote:
>
>> On 06/25/2015 07:18 AM, Pekka Paalanen wrote:
>>> On Sat, 20 Jun 2015 15:47:47 -0700
>>> "Jon A. Cruz" <jonc at osg.samsung.com> wrote:
>>>
>>>>> +static void *setup_test_config(void *data)
>>>>> +{
>>>>> + struct weston_config *config = load_config(data, true);
>>>>> +
>>>>> + if (zuc_has_failure())
>>>>> + ZUC_MARK_FATAL("Fixture setup failed.");
>>>>>
>>>>> return config;
>>>>> }
>>>>>
>>>>> -static const char t0[] =
>>>>> - "# nothing in this file...\n";
>>>>> +static void *setup_test_config_failing(void *data)
>>>>> +{
>>>>> + return load_config(data, false);
>>> What if this actually succeeds in loading the config?
>>> Do we need a clean-up?
>>>
>>
>> As long as the test doesn't crash outright, the object created in the
>> setup function will be freed in the tear-down/cleanup function:
>
> Except it does not: in the tests where you expect the loading to fail
> the function you quoted below is not hooked up. If the correct result is
> getting NULL, then the below would incorrectly flag the test as failed
> when it does the right thing.
Oops. You're right.
I'd fixed that situation in my local branch a while back. Should be all
happy happy now (or once v6 is pushed)
--
Jon A. Cruz - Senior Open Source Developer
Samsung Open Source Group
jonc at osg.samsung.com
More information about the wayland-devel
mailing list