From cb779a71bf57d95b4548fd88494e6f3c803a394d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 10 Dec 2022 10:47:05 +0300 Subject: [PATCH] Compare against '0' in the 'is not off' check --- kconfig_hardened_check/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index d99a6bc..f2e2fe0 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -110,6 +110,8 @@ class OptCheck: if self.expected == 'is not off': if self.state == 'off': self.result = 'FAIL: is off' + if self.state == '0': + self.result = 'FAIL: is off, "0"' elif self.state is None: self.result = 'FAIL: is off, not found' else: @@ -278,7 +280,7 @@ class AND(ComplexOptCheck): self.result = 'FAIL: {} is not "{}"'.format(opt.name, opt.expected) elif opt.result == 'FAIL: is not present': self.result = 'FAIL: {} is not present'.format(opt.name) - elif opt.result == 'FAIL: is off': + elif opt.result == 'FAIL: is off' or opt.result == 'FAIL: is off, "0"': self.result = 'FAIL: {} is off'.format(opt.name) elif opt.result == 'FAIL: is off, not found': self.result = 'FAIL: {} is off, not found'.format(opt.name) -- 2.31.1