summaryrefslogtreecommitdiff
path: root/kconfigtest.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-12 04:18:50 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-12 04:22:44 +0100
commit9914968a94481f84ad0d9cfcb1f5e85334626042 (patch)
treeea53ae404b0ef4e9a7a9c34981811f4ba720dbdc /kconfigtest.py
parent72a904f42156729efc0be5b1bba348e41097199a (diff)
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.
Diffstat (limited to 'kconfigtest.py')
-rw-r--r--kconfigtest.py23
1 files changed, 23 insertions, 0 deletions
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
#