From fa8743fca74f444f29fd33adc8adfa300dfd0656 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 6 Mar 2023 11:13:07 +0300 Subject: [PATCH] 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 --- kconfig_hardened_check/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- 2.31.1