comparison UnitTestsSources/ImageTests.cpp @ 1970:a1c1c606ce98

fix warnings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 Apr 2016 13:07:15 +0200
parents 5bcf721bde4f
children 88831c3edd8f
comparison
equal deleted inserted replaced
1969:5e40f88f4eba 1970:a1c1c606ce98
234 } 234 }
235 235
236 { 236 {
237 Orthanc::JpegReader r1, r2; 237 Orthanc::JpegReader r1, r2;
238 r1.ReadFromFile("UnitTestsResults/hello.jpg"); 238 r1.ReadFromFile("UnitTestsResults/hello.jpg");
239 ASSERT_EQ(16, r1.GetWidth()); 239 ASSERT_EQ(16u, r1.GetWidth());
240 ASSERT_EQ(16, r1.GetHeight()); 240 ASSERT_EQ(16u, r1.GetHeight());
241 241
242 r2.ReadFromMemory(s); 242 r2.ReadFromMemory(s);
243 ASSERT_EQ(16, r2.GetWidth()); 243 ASSERT_EQ(16u, r2.GetWidth());
244 ASSERT_EQ(16, r2.GetHeight()); 244 ASSERT_EQ(16u, r2.GetHeight());
245 245
246 for (unsigned int y = 0; y < r1.GetHeight(); y++) 246 for (unsigned int y = 0; y < r1.GetHeight(); y++)
247 { 247 {
248 const uint8_t* p1 = reinterpret_cast<const uint8_t*>(r1.GetConstRow(y)); 248 const uint8_t* p1 = reinterpret_cast<const uint8_t*>(r1.GetConstRow(y));
249 const uint8_t* p2 = reinterpret_cast<const uint8_t*>(r2.GetConstRow(y)); 249 const uint8_t* p2 = reinterpret_cast<const uint8_t*>(r2.GetConstRow(y));
259 TEST(Font, Basic) 259 TEST(Font, Basic)
260 { 260 {
261 Orthanc::Image s(Orthanc::PixelFormat_RGB24, 640, 480); 261 Orthanc::Image s(Orthanc::PixelFormat_RGB24, 640, 480);
262 memset(s.GetBuffer(), 0, s.GetPitch() * s.GetHeight()); 262 memset(s.GetBuffer(), 0, s.GetPitch() * s.GetHeight());
263 263
264 ASSERT_GE(1, Orthanc::Configuration::GetFontRegistry().GetSize()); 264 ASSERT_GE(1u, Orthanc::Configuration::GetFontRegistry().GetSize());
265 Orthanc::Configuration::GetFontRegistry().GetFont(0).Draw(s, "Hello world É\n\rComment ça va ?\nq", 50, 60, 255, 0, 0); 265 Orthanc::Configuration::GetFontRegistry().GetFont(0).Draw(s, "Hello world É\n\rComment ça va ?\nq", 50, 60, 255, 0, 0);
266 266
267 Orthanc::PngWriter w; 267 Orthanc::PngWriter w;
268 w.WriteToFile("UnitTestsResults/font.png", s); 268 w.WriteToFile("UnitTestsResults/font.png", s);
269 } 269 }