1
0
mirror of https://github.com/altlinux/admc.git synced 2025-01-24 14:12:38 +03:00

fix infinite loop in Gplink::equals()

add test for it
This commit is contained in:
Dmitry Degtyarev 2021-08-13 15:25:56 +04:00
parent 94f804f9c0
commit 7bdf381945
3 changed files with 9 additions and 1 deletions

View File

@ -219,5 +219,5 @@ void Gplink::set_option(const QString &gpo_case, const GplinkOption option, cons
}
bool Gplink::equals(const Gplink &other) const {
return equals(other.to_string());
return (to_string() == other.to_string());
}

View File

@ -54,6 +54,13 @@ void ADMCTestGplink::to_string() {
QCOMPARE(gplink.to_string(), test_gplink_string);
}
void ADMCTestGplink::equals() {
Gplink gplink_1(test_gplink_string);
Gplink gplink_2(test_gplink_string);
QVERIFY(gplink_1.equals(gplink_2));
}
void ADMCTestGplink::contains_data() {
QTest::addColumn<QString>("gpo");
QTest::addColumn<bool>("contains_value");

View File

@ -36,6 +36,7 @@ public slots:
private slots:
void to_string();
void equals();
void contains_data();
void contains();
void add_data();