diff options
author | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-10-09 15:09:57 +0200 |
---|---|---|
committer | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-10-13 12:59:30 +0000 |
commit | 9b134d6354089920d22c8de783093120c44cfb36 (patch) | |
tree | ff61c84ab5ad9181763c3950e77e15aae0fbf269 /autotests/kconfigtest.cpp | |
parent | b0a3e4276e8318475c39c2b7b4b5bc4040dcd19e (diff) | |
download | kconfig-9b134d6354089920d22c8de783093120c44cfb36.tar.gz kconfig-9b134d6354089920d22c8de783093120c44cfb36.tar.bz2 |
Enforce KAuthorized enums being not 0
This will output a warning if an invalid value is requested. The goal is to avoid
implicit conversion which might result in a zero-int value.
Diffstat (limited to 'autotests/kconfigtest.cpp')
-rw-r--r-- | autotests/kconfigtest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 9f88e67b..4657ea8d 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -2082,6 +2082,9 @@ void KConfigTest::testKAuthorizeEnums() QVERIFY(!KAuthorized::authorize(KAuthorized::SHELL_ACCESS)); QVERIFY(!KAuthorized::authorizeAction(KAuthorized::OPEN_WITH)); actionRestrictions.deleteGroup(); + + QVERIFY(!KAuthorized::authorize((KAuthorized::GenericRestriction)0)); + QVERIFY(!KAuthorized::authorizeAction((KAuthorized::GenericAction)0)); } void KConfigTest::testKdeglobalsVsDefault() |