From 9914968a94481f84ad0d9cfcb1f5e85334626042 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 12 Dec 2012 04:18:50 +0100 Subject: Always count non-bool/tristate symbols as 'n' in tristate context. Previously a string symbol that happened to have the value "y" would count as "y" in tristate context, which is incorrect. --- kconfigtest.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'kconfigtest.py') diff --git a/kconfigtest.py b/kconfigtest.py index e9120bd..7927484 100644 --- a/kconfigtest.py +++ b/kconfigtest.py @@ -180,15 +180,38 @@ def run_selftests(): verify_val("n", "n") verify_val("m", "n") verify_val("y", "y") + verify_val("'n'", "n") + verify_val("'m'", "n") + verify_val("'y'", "y") verify_val("M", "y") # Modules c["MODULES"].set_user_value("y") verify_val("n", "n") verify_val("m", "m") verify_val("y", "y") + verify_val("'n'", "n") + verify_val("'m'", "m") + verify_val("'y'", "y") verify_val("M", "m") verify_val("(Y || N) && (m && y)", "m") + # Non-bool/non-tristate symbols are always "n" in a tristate sense + verify_val("Y_STRING", "n") + verify_val("Y_STRING || m", "m") + + # As are all constants besides "y" and "m" + verify_val('"foo"', "n") + verify_val('"foo" || "bar"', "n") + + # Compare some constants... + verify_val('"foo" != "bar"', "y") + verify_val('"foo" = "bar"', "n") + verify_val('"foo" = "foo"', "y") + # As a quirk, undefined values get their name as their value + c.set_print_warnings(False) + verify_val("'not_defined' = not_defined", "y") + verify_val("not_defined_2 = not_defined_2", "y") + # # Text queries # -- cgit v1.2.3