From: Alexander Popov Date: Sat, 10 Dec 2022 07:47:05 +0000 (+0300) Subject: Compare against '0' in the 'is not off' check X-Git-Tag: v0.6.1~31 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=cb779a71bf57d95b4548fd88494e6f3c803a394d;p=kconfig-hardened-check.git Compare against '0' in the 'is not off' check --- 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)