On Tue, Mar 7, 2017 at 2:29 PM, Sebastian Lackner sebastian@fds-team.de wrote:
Based on ideas by Mark Jansen. ...
The with_context macro allows to specify a format string which is printed in case of test failures and for trace messages. Currently, to track down the origin of a test failure, it is necessary to write down all relevant variables in each ok message. With the new macro it is much easier: ...
Hi, Sebastian. I like this idea, it would be specially useful for table struct tests (eg ws2_32) and functions that are called more than once for different tests (eg rsaenh). Each maintainer/helper could slowly update the tests as they think it fits and new tests could start benefiting from it. I hope more people join this conversation as it clearly took a long time to produce the patch and letting it drop from the list without talk would not be nice ;-)
On 14 March 2017 at 01:56, Bruno Jesus 00cpxxx@gmail.com wrote:
Hi, Sebastian. I like this idea, it would be specially useful for table struct tests (eg ws2_32) and functions that are called more than once for different tests (eg rsaenh). Each maintainer/helper could slowly update the tests as they think it fits and new tests could start benefiting from it. I hope more people join this conversation as it clearly took a long time to produce the patch and letting it drop from the list without talk would not be nice ;-)
Well, for what it's worth, I'd welcome the functionality, although personally I'd be tempted to go for winetest_push_context()/winetest_pop_context() and avoid the extra indentation.
On 7 March 2017 at 18:29, Sebastian Lackner sebastian@fds-team.de wrote:
It can also be combined with a loop like:
for (i = 0; i < 100; i++) with_context("i = %d", i) { ... }
But e.g. "break" would be problematic inside such a loop, right?
On 14.03.2017 11:45, Henri Verbeet wrote:
On 14 March 2017 at 01:56, Bruno Jesus 00cpxxx@gmail.com wrote:
Hi, Sebastian. I like this idea, it would be specially useful for table struct tests (eg ws2_32) and functions that are called more than once for different tests (eg rsaenh). Each maintainer/helper could slowly update the tests as they think it fits and new tests could start benefiting from it. I hope more people join this conversation as it clearly took a long time to produce the patch and letting it drop from the list without talk would not be nice ;-)
Well, for what it's worth, I'd welcome the functionality, although personally I'd be tempted to go for winetest_push_context()/winetest_pop_context() and avoid the extra indentation.
Thanks for the feedback. I will send a modified version without the macro if you think it is preferred.
On 7 March 2017 at 18:29, Sebastian Lackner sebastian@fds-team.de wrote:
It can also be combined with a loop like:
for (i = 0; i < 100; i++) with_context("i = %d", i) { ... }
But e.g. "break" would be problematic inside such a loop, right?
Yes, break would be problematic, but continue for example would work fine.
Best regards, Sebastian
On Tue, Mar 14, 2017 at 12:27 PM, Sebastian Lackner sebastian@fds-team.de wrote:
On 7 March 2017 at 18:29, Sebastian Lackner sebastian@fds-team.de wrote:
It can also be combined with a loop like:
for (i = 0; i < 100; i++) with_context("i = %d", i) { ... }
But e.g. "break" would be problematic inside such a loop, right?
Yes, break would be problematic, but continue for example would work fine.
As a workaround you could add a failing ok call before leaving the test explaining about the wrong usage of the macro (the context %s is still open, please fix). So it will never be commited upstream with incorrect usage. Too bad?