From: Alexander Popov Date: Mon, 6 Mar 2023 08:13:07 +0000 (+0300) Subject: backport: Fix the bug in OptCheck.check() introduced in cb779a71bf57d95b X-Git-Tag: v0.6.1 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=fa8743fca74f444f29fd33adc8adfa300dfd0656;hp=295a293b0f21b016b1a9ec0eae1f29e52e70cff1;p=kconfig-hardened-check.git backport: 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/__init__.py b/kconfig_hardened_check/__init__.py index a3a3293..5bc0d37 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -96,7 +96,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'