mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
Merge branch 'development'
This commit is contained in:
commit
4605a8d3c4
@ -248,6 +248,22 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************
|
||||
/// Equality operator
|
||||
//***************************************************
|
||||
friend bool operator ==(const bresenham_line& lhs, const bresenham_line& rhs)
|
||||
{
|
||||
return (lhs.front() == rhs.front()) && (lhs.back() == rhs.back());
|
||||
}
|
||||
|
||||
//***************************************************
|
||||
/// Inequality operator
|
||||
//***************************************************
|
||||
friend bool operator !=(const bresenham_line& lhs, const bresenham_line& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//***************************************************
|
||||
|
||||
@ -404,5 +404,23 @@ namespace
|
||||
CHECK_EQUAL(expected.size(), actual.size());
|
||||
CHECK_ARRAY_EQUAL(expected.data(), actual.data(), (std::max(expected.size(), actual.size())));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_equality)
|
||||
{
|
||||
BresenhamLine bl1(0, 1, 2, 3);
|
||||
BresenhamLine bl2(0, 1, 2, 3);
|
||||
BresenhamLine bl3(0, 1, 2, 4);
|
||||
BresenhamLine bl4(0, 2, 2, 3);
|
||||
|
||||
CHECK(bl1 == bl2);
|
||||
CHECK(!(bl1 != bl2));
|
||||
|
||||
CHECK(bl1 != bl3);
|
||||
CHECK(!(bl1 == bl3));
|
||||
|
||||
CHECK(bl1 != bl4);
|
||||
CHECK(!(bl1 == bl4));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user