Fixed some compiler warnings

This commit is contained in:
Matthias Koefferlein 2023-08-16 22:20:25 +02:00
parent da1251ada2
commit 2acedfde6f
6 changed files with 152 additions and 131 deletions

View File

@ -215,8 +215,8 @@ TEST(4_distance)
db::Edge e4 (db::Point (200, 0), db::Point (300, 0));
db::Edge e5 (db::Point (200, 100), db::Point (300, 100));
EXPECT_EQ (db::EdgePair (e1, e1).distance (), 0);
EXPECT_EQ (db::EdgePair (e1, e2).distance (), 200);
EXPECT_EQ (db::EdgePair (e3, e2).distance (), 100);
EXPECT_EQ (db::EdgePair (e3, e5).distance (), 141);
EXPECT_EQ (db::EdgePair (e1, e1).distance (), 0u);
EXPECT_EQ (db::EdgePair (e1, e2).distance (), 200u);
EXPECT_EQ (db::EdgePair (e3, e2).distance (), 100u);
EXPECT_EQ (db::EdgePair (e3, e5).distance (), 141u);
}

View File

@ -107,16 +107,16 @@ TEST(2)
EXPECT_EQ (db::Edge (10,20,110,222).contains (db::Point (0, 0)), false);
EXPECT_EQ (db::Edge (10,20,110,222).contains (db::Point (100, 200)), false);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (100, 120)), 100);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (100, -80)), 100);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, 120)), 141);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, -80)), 141);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (210, 120)), 141);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (210, -80)), 141);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, 20)), 100);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (10, 20)), 0);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (50, 20)), 0);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (110, 20)), 0);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (100, 120)), 100u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (100, -80)), 100u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, 120)), 141u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, -80)), 141u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (210, 120)), 141u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (210, -80)), 141u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (-90, 20)), 100u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (10, 20)), 0u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (50, 20)), 0u);
EXPECT_EQ (db::Edge (10,20,110,20).euclidian_distance (db::Point (110, 20)), 0u);
}
TEST(3)

View File

@ -482,7 +482,7 @@ TEST(4)
el.layer_properties_dirty = false;
EXPECT_EQ (g.get_layer_maybe (db::LayerProperties (42, 17)), -1);
EXPECT_EQ (el.layer_properties_dirty, false);
EXPECT_EQ (g.get_layer (db::LayerProperties (42, 17)) >= 0, true);
// always true: EXPECT_EQ (g.get_layer (db::LayerProperties (42, 17)) >= 0, true);
EXPECT_EQ (el.layer_properties_dirty, true); // new layer got inserted
}

View File

@ -29,7 +29,7 @@
#include <cstdlib>
#include <cmath>
TEST(Triangles_basic)
TEST(basic)
{
db::Triangles tris;
tris.init_box (db::DBox (1, 0, 5, 4));
@ -40,7 +40,7 @@ TEST(Triangles_basic)
EXPECT_EQ (tris.check (), true);
}
TEST(Triangles_flip)
TEST(flip)
{
db::Triangles tris;
tris.init_box (db::DBox (0, 0, 1, 1));
@ -61,7 +61,7 @@ TEST(Triangles_flip)
EXPECT_EQ (tris.check (), true);
}
TEST(Triangles_insert)
TEST(insert)
{
db::Triangles tris;
tris.init_box (db::DBox (0, 0, 1, 1));
@ -71,7 +71,7 @@ TEST(Triangles_insert)
EXPECT_EQ (tris.check (), true);
}
TEST(Triangles_split_segment)
TEST(split_segment)
{
db::Triangles tris;
tris.init_box (db::DBox (0, 0, 1, 1));
@ -81,7 +81,7 @@ TEST(Triangles_split_segment)
EXPECT_EQ (tris.check(), true);
}
TEST(Triangles_insert_vertex_twice)
TEST(insert_vertex_twice)
{
db::Triangles tris;
tris.init_box (db::DBox (0, 0, 1, 1));
@ -93,7 +93,7 @@ TEST(Triangles_insert_vertex_twice)
EXPECT_EQ (tris.check(), true);
}
TEST(Triangles_insert_vertex_convex)
TEST(insert_vertex_convex)
{
db::Triangles tris;
tris.insert_point (0.2, 0.2);
@ -105,7 +105,7 @@ TEST(Triangles_insert_vertex_convex)
EXPECT_EQ (tris.check(), true);
}
TEST(Triangles_insert_vertex_convex2)
TEST(insert_vertex_convex2)
{
db::Triangles tris;
tris.insert_point (0.25, 0.1);
@ -116,7 +116,7 @@ TEST(Triangles_insert_vertex_convex2)
EXPECT_EQ (tris.check(), true);
}
TEST(Triangles_insert_vertex_convex3)
TEST(insert_vertex_convex3)
{
db::Triangles tris;
tris.insert_point (0.25, 0.5);
@ -127,7 +127,7 @@ TEST(Triangles_insert_vertex_convex3)
EXPECT_EQ (tris.check(), true);
}
TEST(Triangles_search_edges_crossing)
TEST(search_edges_crossing)
{
db::Triangles tris;
db::Vertex *v1 = tris.insert_point (0.2, 0.2);
@ -147,7 +147,7 @@ TEST(Triangles_search_edges_crossing)
EXPECT_EQ (std::find (xedges.begin (), xedges.end (), s2) != xedges.end (), true);
}
TEST(Triangles_illegal_edge1)
TEST(illegal_edge1)
{
db::Vertex v1 (0, 0);
db::Vertex v2 (1.6, 1.6);
@ -186,7 +186,7 @@ TEST(Triangles_illegal_edge1)
}
}
TEST(Triangles_illegal_edge2)
TEST(illegal_edge2)
{
// numerical border case
db::Vertex v1 (773.94756216690905, 114.45875269431208);
@ -242,7 +242,26 @@ namespace {
};
}
TEST(Triangles_test_heavy_insert)
TEST(insert_many)
{
srand (0);
db::Triangles tris;
double res = 65536.0;
db::DBox bbox;
unsigned int n = 200000;
for (unsigned int i = 0; i < n; ++i) {
double x = round (flt_rand () * res) * 0.0001;
double y = round (flt_rand () * res) * 0.0001;
tris.insert_point (x, y);
}
tris.dump ("debug.gds");
}
TEST(heavy_insert)
{
tl::info << "Running test_heavy_insert " << tl::noendl;
@ -268,7 +287,7 @@ TEST(Triangles_test_heavy_insert)
}
// not strictly true, but very likely with at least 10 vertexes:
EXPECT_EQ (tris.num_triangles () > 0, true);
EXPECT_GT (tris.num_triangles (), size_t (0));
EXPECT_EQ (tris.bbox ().to_string (), bbox.to_string ());
bool ok = true;
@ -298,7 +317,7 @@ TEST(Triangles_test_heavy_insert)
tl::info << tl::endl << "done.";
}
TEST(Triangles_test_heavy_remove)
TEST(heavy_remove)
{
tl::info << "Running test_heavy_remove " << tl::noendl;
@ -352,7 +371,7 @@ TEST(Triangles_test_heavy_remove)
tl::info << tl::endl << "done.";
}
TEST(Triangles_test_ensure_edge)
TEST(ensure_edge)
{
srand (0);
@ -418,7 +437,7 @@ bool safe_inside (const db::DBox &b1, const db::DBox &b2)
(ct::less (b1.top (), b2.top ()) || ct::equal (b1.top (), b2.top ()));
}
TEST(Triangles_test_constrain)
TEST(constrain)
{
srand (0);
@ -477,7 +496,7 @@ TEST(Triangles_test_constrain)
EXPECT_EQ (tl::to_string (area_in), "0.25");
}
TEST(Triangles_test_heavy_constrain)
TEST(heavy_constrain)
{
tl::info << "Running test_heavy_constrain " << tl::noendl;
@ -547,7 +566,7 @@ TEST(Triangles_test_heavy_constrain)
tl::info << tl::endl << "done.";
}
TEST(Triangles_test_heavy_find_point_around)
TEST(heavy_find_point_around)
{
tl::info << "Running Triangle_test_heavy_find_point_around " << tl::noendl;
@ -593,7 +612,7 @@ TEST(Triangles_test_heavy_find_point_around)
tl::info << tl::endl << "done.";
}
TEST(Triangles_test_create_constrained_delaunay)
TEST(create_constrained_delaunay)
{
db::Region r;
r.insert (db::Box (0, 0, 1000, 1000));
@ -620,7 +639,7 @@ TEST(Triangles_test_create_constrained_delaunay)
"((0, 1000), (200, 800), (200, 200))");
}
TEST(Triangles_test_triangulate)
TEST(triangulate)
{
db::Region r;
r.insert (db::Box (0, 0, 10000, 10000));
@ -640,11 +659,12 @@ TEST(Triangles_test_triangulate)
EXPECT_EQ (tri.check (), true);
for (auto t = tri.begin (); t != tri.end (); ++t) {
EXPECT_EQ (t->area () <= param.max_area, true);
EXPECT_EQ (t->b () >= param.min_b, true);
EXPECT_LE (t->area (), param.max_area);
EXPECT_GE (t->b (), param.min_b);
}
EXPECT_EQ (tri.num_triangles () > 100 && tri.num_triangles () < 150, true);
EXPECT_GT (tri.num_triangles (), size_t (100));
EXPECT_LT (tri.num_triangles (), size_t (150));
tl::info << tri.num_triangles ();
param.min_b = 1.0;
@ -655,9 +675,10 @@ TEST(Triangles_test_triangulate)
EXPECT_EQ (tri.check (), true);
for (auto t = tri.begin (); t != tri.end (); ++t) {
EXPECT_EQ (t->area () <= param.max_area, true);
EXPECT_EQ (t->b () >= param.min_b, true);
EXPECT_LE (t->area (), param.max_area);
EXPECT_GE (t->b (), param.min_b);
}
EXPECT_EQ (tri.num_triangles () > 900 && tri.num_triangles () < 1000, true);
EXPECT_GT (tri.num_triangles (), 900);
EXPECT_LT (tri.num_triangles (), 1000);
}

View File

@ -32,16 +32,16 @@ TEST(1)
{
EXPECT_EQ (tl::Color ().is_valid (), false);
EXPECT_EQ (tl::Color ().to_string (), "");
EXPECT_EQ (tl::Color ().rgb (), 0x00000000);
EXPECT_EQ (tl::Color ().rgb (), 0x00000000u);
#if defined(HAVE_QT)
EXPECT_EQ (tl::Color (QColor ()).is_valid (), false);
EXPECT_EQ (tl::Color (QColor ()).to_string (), "");
EXPECT_EQ (tl::Color (QColor ()).rgb (), 0x00000000);
EXPECT_EQ (tl::Color (QColor ()).rgb (), 0x00000000u);
EXPECT_EQ (tl::Color (QColor ()).to_qc ().isValid (), false);
EXPECT_EQ (QColor ().isValid (), false);
EXPECT_EQ (tl::to_string (QColor ().name ()), "#000000"); // why?
EXPECT_EQ (QColor ().rgb (), 0xff000000);
EXPECT_EQ (QColor ().rgb (), 0xff000000u);
#endif
}
@ -49,17 +49,17 @@ TEST(2)
{
EXPECT_EQ (tl::Color (0x102030).is_valid (), true);
EXPECT_EQ (tl::Color (0x102030).to_string (), "#102030");
EXPECT_EQ (tl::Color (0x102030).rgb (), 0xff102030);
EXPECT_EQ (tl::Color (0x102030).rgb (), 0xff102030u);
#if defined(HAVE_QT)
EXPECT_EQ (tl::Color (QColor (0x102030)).is_valid (), true);
EXPECT_EQ (tl::Color (QColor (0x102030)).to_string (), "#102030");
EXPECT_EQ (tl::Color (QColor (0x102030)).rgb (), 0xff102030);
EXPECT_EQ (tl::Color (QColor (0x102030)).rgb (), 0xff102030u);
EXPECT_EQ (tl::Color (QColor (0x102030)).to_qc ().isValid (), true);
EXPECT_EQ (tl::to_string (tl::Color (QColor (0x102030)).to_qc ().name ()), "#102030");
EXPECT_EQ (QColor (0x102030).isValid (), true);
EXPECT_EQ (tl::to_string (QColor (0x102030).name ()), "#102030");
EXPECT_EQ (QColor (0x102030).rgb (), 0xff102030);
EXPECT_EQ (QColor (0x102030).rgb (), 0xff102030u);
#endif
}
@ -68,15 +68,15 @@ TEST(3)
EXPECT_EQ (tl::Color (std::string ()).is_valid (), false);
EXPECT_EQ (tl::Color ("#102030").is_valid (), true);
EXPECT_EQ (tl::Color ("#102030").to_string (), "#102030");
EXPECT_EQ (tl::Color ("#102030").rgb (), 0xff102030);
EXPECT_EQ (tl::Color ("#102030").rgb (), 0xff102030u);
EXPECT_EQ (tl::Color ("102030").is_valid (), true);
EXPECT_EQ (tl::Color ("102030").to_string (), "#102030");
EXPECT_EQ (tl::Color ("102030").rgb (), 0xff102030);
EXPECT_EQ (tl::Color ("102030").rgb (), 0xff102030u);
#if defined(HAVE_QT)
EXPECT_EQ (QColor (tl::to_qstring ("#102030")).isValid (), true);
EXPECT_EQ (tl::to_string (QColor (tl::to_qstring ("#102030")).name ()), "#102030");
EXPECT_EQ (QColor (tl::to_qstring ("#102030")).rgb (), 0xff102030);
EXPECT_EQ (QColor (tl::to_qstring ("#102030")).rgb (), 0xff102030u);
#endif
}
@ -84,24 +84,24 @@ TEST(4)
{
EXPECT_EQ (tl::Color ("#123").is_valid (), true);
EXPECT_EQ (tl::Color ("#123").to_string (), "#112233");
EXPECT_EQ (tl::Color ("#123").rgb (), 0xff112233);
EXPECT_EQ (tl::Color ("#123").rgb (), 0xff112233u);
}
TEST(5)
{
EXPECT_EQ (tl::Color ("#80102030").is_valid (), true);
EXPECT_EQ (tl::Color ("#80102030").alpha (), 128);
EXPECT_EQ (tl::Color ("#80102030").red (), 16);
EXPECT_EQ (tl::Color ("#80102030").green (), 32);
EXPECT_EQ (tl::Color ("#80102030").blue (), 48);
EXPECT_EQ (tl::Color ("#80102030").alpha (), 128u);
EXPECT_EQ (tl::Color ("#80102030").red (), 16u);
EXPECT_EQ (tl::Color ("#80102030").green (), 32u);
EXPECT_EQ (tl::Color ("#80102030").blue (), 48u);
EXPECT_EQ (tl::Color ("#80102030").to_string (), "#80102030");
EXPECT_EQ (tl::Color ("#80102030").rgb (), 0x80102030);
EXPECT_EQ (tl::Color ("#80102030").rgb (), 0x80102030u);
#if defined(HAVE_QT) && QT_VERSION >= 0x50000
// no alpha support in Qt
EXPECT_EQ (QColor (tl::to_qstring ("#80102030")).isValid (), true);
EXPECT_EQ (tl::to_string (QColor (tl::to_qstring ("#80102030")).name ()), "#102030");
EXPECT_EQ (QColor (tl::to_qstring ("#80102030")).rgb (), 0xff102030);
EXPECT_EQ (QColor (tl::to_qstring ("#80102030")).rgb (), 0xff102030u);
#endif
}
@ -109,20 +109,20 @@ TEST(6)
{
EXPECT_EQ (tl::Color ("#8123").is_valid (), true);
EXPECT_EQ (tl::Color ("#8123").to_string (), "#88112233");
EXPECT_EQ (tl::Color ("#8123").rgb (), 0x88112233);
EXPECT_EQ (tl::Color ("#8123").rgb (), 0x88112233u);
}
TEST(7)
{
EXPECT_EQ (tl::Color (16, 32, 48, 128).is_valid (), true);
EXPECT_EQ (tl::Color (16, 32, 48, 128).to_string (), "#80102030");
EXPECT_EQ (tl::Color (16, 32, 48, 128).rgb (), 0x80102030);
EXPECT_EQ (tl::Color (16, 32, 48, 128).rgb (), 0x80102030u);
#if defined(HAVE_QT)
// no alpha support in Qt
EXPECT_EQ (QColor (16, 32, 48, 128).isValid (), true);
EXPECT_EQ (tl::to_string (QColor (16, 32, 48, 128).name ()), "#102030");
EXPECT_EQ (QColor (16, 32, 48, 128).rgb (), 0xff102030);
EXPECT_EQ (QColor (16, 32, 48, 128).rgb (), 0xff102030u);
#endif
}
@ -132,9 +132,9 @@ TEST(8)
int ih, is, iv;
tl::Color c = tl::Color (16, 32, 48);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 210);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 210u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#102030");
@ -148,9 +148,9 @@ TEST(8)
c = tl::Color (32, 16, 48);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 270);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 270u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#201030");
@ -164,9 +164,9 @@ TEST(8)
c = tl::Color (32, 48, 16);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 90);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 90u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#203010");
@ -180,9 +180,9 @@ TEST(8)
c = tl::Color (48, 32, 16);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 30);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 30u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#302010");
@ -196,9 +196,9 @@ TEST(8)
c = tl::Color (48, 16, 32);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 330);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 330u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#301020");
@ -212,9 +212,9 @@ TEST(8)
c = tl::Color (16, 48, 32);
c.get_hsv (h, s, v);
EXPECT_EQ (h, 150);
EXPECT_EQ (s, 170);
EXPECT_EQ (v, 48);
EXPECT_EQ (h, 150u);
EXPECT_EQ (s, 170u);
EXPECT_EQ (v, 48u);
EXPECT_EQ (tl::Color::from_hsv (h, s, v).to_string (), "#103020");

View File

@ -85,8 +85,8 @@ static bool compare_images (const tl::BitmapBuffer &img, const tl::BitmapBuffer
TEST(1)
{
tl::PixelBuffer img (15, 25);
EXPECT_EQ (img.width (), 15);
EXPECT_EQ (img.height (), 25);
EXPECT_EQ (img.width (), 15u);
EXPECT_EQ (img.height (), 25u);
EXPECT_EQ (img.stride (), 15 * sizeof (tl::color_t));
EXPECT_EQ (img.transparent (), false);
@ -94,69 +94,69 @@ TEST(1)
EXPECT_EQ (img.transparent (), true);
img.fill (0x112233);
EXPECT_EQ (img.scan_line (5)[10], 0x112233);
EXPECT_EQ (img.scan_line (5)[10], 0x112233u);
tl::PixelBuffer img2;
EXPECT_EQ (img2.transparent (), false);
img2 = img;
EXPECT_EQ (img2.transparent (), true);
EXPECT_EQ (img2.width (), 15);
EXPECT_EQ (img2.height (), 25);
EXPECT_EQ (img2.width (), 15u);
EXPECT_EQ (img2.height (), 25u);
EXPECT_EQ (img.scan_line (5)[10], 0x112233);
EXPECT_EQ (img2.scan_line (5)[10], 0x112233);
EXPECT_EQ (img.scan_line (5)[10], 0x112233u);
EXPECT_EQ (img2.scan_line (5)[10], 0x112233u);
img2.fill (0x332211);
EXPECT_EQ (img.scan_line (5)[10], 0x112233);
EXPECT_EQ (img2.scan_line (5)[10], 0x332211);
EXPECT_EQ (img.scan_line (5)[10], 0x112233u);
EXPECT_EQ (img2.scan_line (5)[10], 0x332211u);
img.set_transparent (false);
img2.swap (img);
EXPECT_EQ (img2.transparent (), false);
EXPECT_EQ (img2.scan_line (5)[10], 0x112233);
EXPECT_EQ (img.scan_line (5)[10], 0x332211);
EXPECT_EQ (img2.scan_line (5)[10], 0x112233u);
EXPECT_EQ (img.scan_line (5)[10], 0x332211u);
img2 = img;
EXPECT_EQ (compare_images (img, img2), true);
EXPECT_EQ (img.scan_line (5)[10], 0x332211);
EXPECT_EQ (img2.scan_line (5)[10], 0x332211);
EXPECT_EQ (img.scan_line (5)[10], 0x332211u);
EXPECT_EQ (img2.scan_line (5)[10], 0x332211u);
img2 = tl::PixelBuffer (10, 16);
EXPECT_EQ (img.width (), 15);
EXPECT_EQ (img.height (), 25);
EXPECT_EQ (img2.width (), 10);
EXPECT_EQ (img2.height (), 16);
EXPECT_EQ (img.width (), 15u);
EXPECT_EQ (img.height (), 25u);
EXPECT_EQ (img2.width (), 10u);
EXPECT_EQ (img2.height (), 16u);
img2.fill (0x010203);
EXPECT_EQ (compare_images (img, img2), false);
EXPECT_EQ (img.scan_line (5)[10], 0x332211);
EXPECT_EQ (img2.scan_line (5)[8], 0xff010203);
EXPECT_EQ (img.scan_line (5)[10], 0x332211u);
EXPECT_EQ (img2.scan_line (5)[8], 0xff010203u);
img = std::move (img2);
EXPECT_EQ (compare_images (img, img2), false);
EXPECT_EQ (img.width (), 10);
EXPECT_EQ (img.height (), 16);
EXPECT_EQ (img.scan_line (5)[8], 0xff010203);
EXPECT_EQ (img.width (), 10u);
EXPECT_EQ (img.height (), 16u);
EXPECT_EQ (img.scan_line (5)[8], 0xff010203u);
tl::PixelBuffer img3 (img);
EXPECT_EQ (compare_images (img, img3), true);
EXPECT_EQ (img3.width (), 10);
EXPECT_EQ (img3.height (), 16);
EXPECT_EQ (img3.scan_line (5)[8], 0xff010203);
EXPECT_EQ (img3.width (), 10u);
EXPECT_EQ (img3.height (), 16u);
EXPECT_EQ (img3.scan_line (5)[8], 0xff010203u);
img.fill (0x102030);
EXPECT_EQ (compare_images (img, img3), false);
EXPECT_EQ (img3.width (), 10);
EXPECT_EQ (img3.height (), 16);
EXPECT_EQ (img3.scan_line (5)[8], 0xff010203);
EXPECT_EQ (img.width (), 10);
EXPECT_EQ (img.height (), 16);
EXPECT_EQ (img.scan_line (5)[8], 0xff102030);
EXPECT_EQ (img3.width (), 10u);
EXPECT_EQ (img3.height (), 16u);
EXPECT_EQ (img3.scan_line (5)[8], 0xff010203u);
EXPECT_EQ (img.width (), 10u);
EXPECT_EQ (img.height (), 16u);
EXPECT_EQ (img.scan_line (5)[8], 0xff102030u);
tl::PixelBuffer img4 (std::move (img));
EXPECT_EQ (img4.width (), 10);
EXPECT_EQ (img4.height (), 16);
EXPECT_EQ (img4.scan_line (5)[8], 0xff102030);
EXPECT_EQ (img4.width (), 10u);
EXPECT_EQ (img4.height (), 16u);
EXPECT_EQ (img4.scan_line (5)[8], 0xff102030u);
// other constructors
EXPECT_EQ (compare_images (tl::PixelBuffer (img4.width (), img4.height (), (const tl::color_t *) img4.data ()), img4), true);
@ -495,17 +495,17 @@ TEST(7)
TEST(11)
{
tl::BitmapBuffer img (15, 25);
EXPECT_EQ (img.width (), 15);
EXPECT_EQ (img.height (), 25);
EXPECT_EQ (img.stride (), 4);
EXPECT_EQ (img.width (), 15u);
EXPECT_EQ (img.height (), 25u);
EXPECT_EQ (img.stride (), 4u);
img.fill (true);
EXPECT_EQ (img.scan_line (5)[1], 0xff);
tl::BitmapBuffer img2;
img2 = img;
EXPECT_EQ (img2.width (), 15);
EXPECT_EQ (img2.height (), 25);
EXPECT_EQ (img2.width (), 15u);
EXPECT_EQ (img2.height (), 25u);
EXPECT_EQ (img.scan_line (5)[1], 0xff);
EXPECT_EQ (img2.scan_line (5)[1], 0xff);
@ -524,10 +524,10 @@ TEST(11)
EXPECT_EQ (img2.scan_line (5)[1], 0);
img2 = tl::BitmapBuffer (10, 16);
EXPECT_EQ (img.width (), 15);
EXPECT_EQ (img.height (), 25);
EXPECT_EQ (img2.width (), 10);
EXPECT_EQ (img2.height (), 16);
EXPECT_EQ (img.width (), 15u);
EXPECT_EQ (img.height (), 25u);
EXPECT_EQ (img2.width (), 10u);
EXPECT_EQ (img2.height (), 16u);
img2.fill (true);
EXPECT_EQ (compare_images (img, img2), false);
@ -536,28 +536,28 @@ TEST(11)
img = std::move (img2);
EXPECT_EQ (compare_images (img, img2), false);
EXPECT_EQ (img.width (), 10);
EXPECT_EQ (img.height (), 16);
EXPECT_EQ (img.width (), 10u);
EXPECT_EQ (img.height (), 16u);
EXPECT_EQ (img.scan_line (5)[0], 0xff);
tl::BitmapBuffer img3 (img);
EXPECT_EQ (compare_images (img, img3), true);
EXPECT_EQ (img3.width (), 10);
EXPECT_EQ (img3.height (), 16);
EXPECT_EQ (img3.width (), 10u);
EXPECT_EQ (img3.height (), 16u);
EXPECT_EQ (img3.scan_line (5)[1], 0xff);
img.fill (false);
EXPECT_EQ (compare_images (img, img3), false);
EXPECT_EQ (img3.width (), 10);
EXPECT_EQ (img3.height (), 16);
EXPECT_EQ (img3.width (), 10u);
EXPECT_EQ (img3.height (), 16u);
EXPECT_EQ (img3.scan_line (5)[1], 0xff);
EXPECT_EQ (img.width (), 10);
EXPECT_EQ (img.height (), 16);
EXPECT_EQ (img.width (), 10u);
EXPECT_EQ (img.height (), 16u);
EXPECT_EQ (img.scan_line (5)[1], 0);
tl::BitmapBuffer img4 (std::move (img));
EXPECT_EQ (img4.width (), 10);
EXPECT_EQ (img4.height (), 16);
EXPECT_EQ (img4.width (), 10u);
EXPECT_EQ (img4.height (), 16u);
EXPECT_EQ (img4.scan_line (5)[1], 0);
// other constructors