Mercurial > hg > orthanc
comparison UnitTestsSources/Png.cpp @ 803:4689e400e0fa
directory to store the results of the unit tests
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 09:29:11 +0200 |
parents | 777b6b694da6 |
children | 3d6f9b7d0add |
comparison
equal
deleted
inserted
replaced
802:82b07ab959f4 | 803:4689e400e0fa |
---|---|
24 p[1] = (y % 3 == 1) ? 255 : 0; | 24 p[1] = (y % 3 == 1) ? 255 : 0; |
25 p[2] = (y % 3 == 2) ? 255 : 0; | 25 p[2] = (y % 3 == 2) ? 255 : 0; |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 w.WriteToFile("ColorPattern.png", width, height, pitch, Orthanc::PixelFormat_RGB24, &image[0]); | 29 w.WriteToFile("UnitTestsResults/ColorPattern.png", width, height, pitch, Orthanc::PixelFormat_RGB24, &image[0]); |
30 | 30 |
31 std::string f, md5; | 31 std::string f, md5; |
32 Orthanc::Toolbox::ReadFile(f, "ColorPattern.png"); | 32 Orthanc::Toolbox::ReadFile(f, "UnitTestsResults/ColorPattern.png"); |
33 Orthanc::Toolbox::ComputeMD5(md5, f); | 33 Orthanc::Toolbox::ComputeMD5(md5, f); |
34 ASSERT_EQ("604e785f53c99cae6ea4584870b2c41d", md5); | 34 ASSERT_EQ("604e785f53c99cae6ea4584870b2c41d", md5); |
35 } | 35 } |
36 | 36 |
37 TEST(PngWriter, Gray8Pattern) | 37 TEST(PngWriter, Gray8Pattern) |
49 { | 49 { |
50 *p = y; | 50 *p = y; |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 w.WriteToFile("Gray8Pattern.png", width, height, pitch, Orthanc::PixelFormat_Grayscale8, &image[0]); | 54 w.WriteToFile("UnitTestsResults/Gray8Pattern.png", width, height, pitch, Orthanc::PixelFormat_Grayscale8, &image[0]); |
55 | 55 |
56 std::string f, md5; | 56 std::string f, md5; |
57 Orthanc::Toolbox::ReadFile(f, "Gray8Pattern.png"); | 57 Orthanc::Toolbox::ReadFile(f, "UnitTestsResults/Gray8Pattern.png"); |
58 Orthanc::Toolbox::ComputeMD5(md5, f); | 58 Orthanc::Toolbox::ComputeMD5(md5, f); |
59 ASSERT_EQ("5a9b98bea3d0a6d983980cc38bfbcdb3", md5); | 59 ASSERT_EQ("5a9b98bea3d0a6d983980cc38bfbcdb3", md5); |
60 } | 60 } |
61 | 61 |
62 TEST(PngWriter, Gray16Pattern) | 62 TEST(PngWriter, Gray16Pattern) |
76 { | 76 { |
77 *p = v; | 77 *p = v; |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 w.WriteToFile("Gray16Pattern.png", width, height, pitch, Orthanc::PixelFormat_Grayscale16, &image[0]); | 81 w.WriteToFile("UnitTestsResults/Gray16Pattern.png", width, height, pitch, Orthanc::PixelFormat_Grayscale16, &image[0]); |
82 | 82 |
83 std::string f, md5; | 83 std::string f, md5; |
84 Orthanc::Toolbox::ReadFile(f, "Gray16Pattern.png"); | 84 Orthanc::Toolbox::ReadFile(f, "UnitTestsResults/Gray16Pattern.png"); |
85 Orthanc::Toolbox::ComputeMD5(md5, f); | 85 Orthanc::Toolbox::ComputeMD5(md5, f); |
86 ASSERT_EQ("0785866a08bf0a02d2eeff87f658571c", md5); | 86 ASSERT_EQ("0785866a08bf0a02d2eeff87f658571c", md5); |
87 } | 87 } |
88 | 88 |
89 TEST(PngWriter, EndToEnd) | 89 TEST(PngWriter, EndToEnd) |