From d006bfa48e87600e70aae1a696ede3182f6c1cbd Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 5 Mar 2023 23:56:45 +0300 Subject: [PATCH] Fix the bug in OptCheck.check() introduced in cb779a71bf57d95b Use 'elif' instead of 'if' to avoid wrong self.result when self.state is 'off'. We need unit-tests for the engine checking the correctness: #79 --- kconfig_hardened_check/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kconfig_hardened_check/engine.py b/kconfig_hardened_check/engine.py index 0d27b77..6308740 100644 --- a/kconfig_hardened_check/engine.py +++ b/kconfig_hardened_check/engine.py @@ -62,7 +62,7 @@ class OptCheck: if self.expected == 'is not off': if self.state == 'off': self.result = 'FAIL: is off' - if self.state == '0': + elif self.state == '0': self.result = 'FAIL: is off, "0"' elif self.state is None: self.result = 'FAIL: is off, not found' -- 2.31.1