diff --git a/tests/admc_test_ad_security.cpp b/tests/admc_test_ad_security.cpp index e23a7221..1b889f97 100644 --- a/tests/admc_test_ad_security.cpp +++ b/tests/admc_test_ad_security.cpp @@ -116,7 +116,7 @@ void ADMCTestAdSecurity::handle_generic_read_and_write_sharing_bit() { for (const uint32_t &mask : opposite_map.keys()) { const uint32_t opposite = opposite_map[mask]; SecurityRight right{mask, QByteArray(), QByteArray(), 0}; - SecurityRight right_opposite{mask, QByteArray(), QByteArray(), 0}; + SecurityRight right_opposite{opposite, QByteArray(), QByteArray(), 0}; security_descriptor_add_right(sd, ad.adconfig(), class_list, test_trustee, right, true); security_descriptor_add_right(sd, ad.adconfig(), class_list, test_trustee, right_opposite, true); @@ -240,7 +240,7 @@ void ADMCTestAdSecurity::remove_to_set_subordinates_data() { QTest::addColumn("superior_mask"); QTest::addColumn("subordinate_right_type"); QTest::addColumn>("subordinate_mask_list"); - QTest::addColumn("exptected_state"); + QTest::addColumn("expected_state"); const QByteArray type_web_info = ad.adconfig()->get_right_guid("Web-Information"); const QByteArray type_change_password = ad.adconfig()->get_right_guid("User-Change-Password"); @@ -252,7 +252,6 @@ void ADMCTestAdSecurity::remove_to_set_subordinates_data() { QTest::newRow("allow generic write") << true << SEC_ADS_GENERIC_WRITE << type_web_info << QList({SEC_ADS_WRITE_PROP}) << TestAdSecurityType_Allow; QTest::newRow("deny generic write") << false << SEC_ADS_GENERIC_WRITE << type_web_info << QList({SEC_ADS_WRITE_PROP}) << TestAdSecurityType_Deny; QTest::newRow("allow all extended rights") << true << SEC_ADS_CONTROL_ACCESS << type_change_password << QList({SEC_ADS_CONTROL_ACCESS}) << TestAdSecurityType_Allow; - QTest::newRow("allow all extended rights") << true << SEC_ADS_CONTROL_ACCESS << type_change_password << QList({SEC_ADS_CONTROL_ACCESS}) << TestAdSecurityType_Allow; QTest::newRow("deny all extended rights") << false << SEC_ADS_CONTROL_ACCESS << type_change_password << QList({SEC_ADS_CONTROL_ACCESS}) << TestAdSecurityType_Deny; } @@ -261,7 +260,7 @@ void ADMCTestAdSecurity::remove_to_set_subordinates() { QFETCH(int, superior_mask); QFETCH(QByteArray, subordinate_right_type); QFETCH(QList, subordinate_mask_list); - QFETCH(TestAdSecurityType, exptected_state); + QFETCH(TestAdSecurityType, expected_state); SecurityRight right{(uint32_t)superior_mask, QByteArray(), QByteArray(), 0}; @@ -269,11 +268,11 @@ void ADMCTestAdSecurity::remove_to_set_subordinates() { security_descriptor_add_right(sd, ad.adconfig(), class_list, test_trustee, right, allow_superior); // Superior should be set - check_state(test_trustee, superior_mask, QByteArray(), exptected_state); + check_state(test_trustee, superior_mask, QByteArray(), expected_state); // Subordinate should be set for (const int &subordinate_mask : subordinate_mask_list) { - check_state(test_trustee, subordinate_mask, subordinate_right_type, exptected_state); + check_state(test_trustee, subordinate_mask, subordinate_right_type, expected_state); } // Remove superior @@ -282,9 +281,9 @@ void ADMCTestAdSecurity::remove_to_set_subordinates() { // Superior should be unset check_state(test_trustee, superior_mask, QByteArray(), TestAdSecurityType_None); - // But subordinates should remain + // But subordinates should be unset for (const int &subordinate_mask : subordinate_mask_list) { - check_state(test_trustee, subordinate_mask, subordinate_right_type, exptected_state); + check_state(test_trustee, subordinate_mask, subordinate_right_type, TestAdSecurityType_None); } }