From 9b1be0c77a4f77e8d7f11369599ad52a709f36f7 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 10 May 2020 23:59:09 -0400 Subject: [PATCH] More TODO resolution. --- test/controls.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/controls.c b/test/controls.c index 83379648..d757ff7c 100644 --- a/test/controls.c +++ b/test/controls.c @@ -295,8 +295,7 @@ Test(SetParentWithNullControlIsProgrammerError) endCheckProgrammerError(ctx); } -// TODO copy this test but first setting and then removing the parent first, instead of just testing the initial state -Test(RemovingParentFromParentlessControlIsProgrammerError) +Test(RemovingParentFromInitiallyParentlessControlIsProgrammerError) { uiControl *c; void *ctx; @@ -308,6 +307,22 @@ Test(RemovingParentFromParentlessControlIsProgrammerError) endCheckProgrammerError(ctx); } +Test(RemovingParentFromExplicitlyParentlessControlIsProgrammerError) +{ + uiControl *c, *d; + void *ctx; + + ctx = beginCheckProgrammerError("uiControlSetParent(): cannot set a control with no parent to have no parent"); + c = uiNewControl(testControlType(), NULL); + d = uiNewControl(testControlType(), NULL); + uiControlSetParent(c, d); + uiControlSetParent(c, NULL); + uiControlSetParent(c, NULL); + uiControlFree(c); + uiControlFree(d); + endCheckProgrammerError(ctx); +} + Test(ReparentingAlreadyParentedControlIsProgrammerError) { uiControl *c, *d, *e; @@ -332,7 +347,7 @@ Test(ReparentingAlreadyParentedControlIsProgrammerError) endCheckProgrammerError(ctx); } -// TODO define and then test the above but for the same parent +// TODO document and then test the above but for the same parent Test(GettingImplDataOfNullControlIsProgrammerError) {