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:
parent
94f804f9c0
commit
7bdf381945
@ -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());
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -36,6 +36,7 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void to_string();
|
||||
void equals();
|
||||
void contains_data();
|
||||
void contains();
|
||||
void add_data();
|
||||
|
Loading…
x
Reference in New Issue
Block a user