Mercurial > hg > orthanc
comparison UnitTestsSources/ImageTests.cpp @ 2707:38a3054b22ff
improvement
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 06 Jul 2018 16:51:08 +0200 |
parents | 52217dc47a4e |
children | 4767d36679ed |
comparison
equal
deleted
inserted
replaced
2706:0511feaf0ec2 | 2707:38a3054b22ff |
---|---|
392 ASSERT_EQ(r.GetHeight(), height); | 392 ASSERT_EQ(r.GetHeight(), height); |
393 | 393 |
394 v = 0; | 394 v = 0; |
395 for (unsigned int y = 0; y < height; y++) | 395 for (unsigned int y = 0; y < height; y++) |
396 { | 396 { |
397 const uint16_t *p = reinterpret_cast<const uint16_t*>((const uint8_t*) r.GetConstBuffer() + y * r.GetPitch()); | 397 const uint16_t *p = reinterpret_cast<const uint16_t*> |
398 ((const uint8_t*) r.GetConstBuffer() + y * r.GetPitch()); | |
398 ASSERT_EQ(p, r.GetConstRow(y)); | 399 ASSERT_EQ(p, r.GetConstRow(y)); |
399 for (unsigned int x = 0; x < width; x++, p++, v++) | 400 for (unsigned int x = 0; x < width; x++, p++, v++) |
400 { | 401 { |
401 ASSERT_EQ(v, *p); | 402 ASSERT_EQ(v, *p); |
402 } | 403 } |
415 ASSERT_EQ(r2.GetHeight(), height); | 416 ASSERT_EQ(r2.GetHeight(), height); |
416 | 417 |
417 v = 0; | 418 v = 0; |
418 for (unsigned int y = 0; y < height; y++) | 419 for (unsigned int y = 0; y < height; y++) |
419 { | 420 { |
420 const uint16_t *p = reinterpret_cast<const uint16_t*>((const uint8_t*) r2.GetConstBuffer() + y * r2.GetPitch()); | 421 const uint16_t *p = reinterpret_cast<const uint16_t*> |
422 ((const uint8_t*) r2.GetConstBuffer() + y * r2.GetPitch()); | |
421 ASSERT_EQ(p, r2.GetConstRow(y)); | 423 ASSERT_EQ(p, r2.GetConstRow(y)); |
422 for (unsigned int x = 0; x < width; x++, p++, v++) | 424 for (unsigned int x = 0; x < width; x++, p++, v++) |
423 { | 425 { |
424 ASSERT_EQ(*p, v); | 426 ASSERT_EQ(*p, v); |
425 } | 427 } |