From: Alexander Popov Date: Sun, 5 Mar 2023 20:56:45 +0000 (+0300) Subject: Fix the bug in OptCheck.check() introduced in cb779a71bf57d95b X-Git-Tag: v0.6.6~228 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=d006bfa48e87600e70aae1a696ede3182f6c1cbd;p=kconfig-hardened-check.git 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 --- 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'