From 411ac155a56b8e4874ab9713210fb7e8923022bc Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 15 Dec 2012 15:37:28 +0100 Subject: Add more selftests for choices with missing types. --- tests/Kchoice | 17 +++++++++++++++++ testsuite.py | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/tests/Kchoice b/tests/Kchoice index 1915b1d..481e438 100644 --- a/tests/Kchoice +++ b/tests/Kchoice @@ -94,3 +94,20 @@ config NTT_2 config NTT_3 bool "NTT_3" endchoice + +# Choice items without an explicitly specified type should get the type of the +# choice + +choice MISSING_MEMBER_TYPES_1 + bool "missing member types" +config MMT_1 +config MMT_2 +config MMT_3 + tristate +endchoice + +choice MISSING_MEMBER_TYPES_2 +config MMT_4 +config MMT_5 + bool +endchoice diff --git a/testsuite.py b/testsuite.py index d0d2214..d93b981 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1215,7 +1215,9 @@ def run_selftests(): choice_bool, choice_bool_opt, choice_tristate, choice_tristate_opt, \ choice_bool_m, choice_tristate_m, choice_defaults, \ - choice_no_type_bool, choice_no_type_tristate = c.get_choices() + choice_no_type_bool, choice_no_type_tristate, \ + choice_missing_member_type_1, choice_missing_member_type_2 \ + = c.get_choices() for choice in (choice_bool, choice_bool_opt, choice_bool_m, choice_defaults): @@ -1317,6 +1319,18 @@ def run_selftests(): "Expected second choice without explicit type to have type " "tristate") + # Verify that symbols without a type in the choice get the type of the + # choice + + verify((c["MMT_1"].get_type(), c["MMT_2"].get_type(), + c["MMT_3"].get_type()) == + (kconfiglib.BOOL, kconfiglib.BOOL, kconfiglib.TRISTATE), + "Wrong types for first choice with missing member types") + + verify((c["MMT_4"].get_type(), c["MMT_5"].get_type()) == + (kconfiglib.BOOL, kconfiglib.BOOL), + "Wrong types for first choice with missing member types") + # # Object dependencies # -- cgit v1.2.3