# HG changeset patch # User jodogne # Date 1438692455 -7200 # Node ID 9f66a12eb8fcd4ceb427c957d204b7a9b460a511 # Parent e460341872dc923e6b8d5d0973599cdf420c609b fix warnings for gcc 5 diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/DicomMapTests.cpp --- a/UnitTestsSources/DicomMapTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/DicomMapTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -87,7 +87,7 @@ DicomMap m; m.GetTags(s); - ASSERT_EQ(0, s.size()); + ASSERT_EQ(0u, s.size()); ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME)); ASSERT_FALSE(m.HasTag(0x0010, 0x0010)); @@ -96,7 +96,7 @@ ASSERT_TRUE(m.HasTag(0x0010, 0x0010)); m.GetTags(s); - ASSERT_EQ(1, s.size()); + ASSERT_EQ(1u, s.size()); ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID)); @@ -106,13 +106,13 @@ ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).AsString()); m.GetTags(s); - ASSERT_EQ(2, s.size()); + ASSERT_EQ(2u, s.size()); m.Remove(DICOM_TAG_PATIENT_ID); ASSERT_THROW(m.GetValue(0x0010, 0x0020), OrthancException); m.GetTags(s); - ASSERT_EQ(1, s.size()); + ASSERT_EQ(1u, s.size()); ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); std::auto_ptr mm(m.Clone()); diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/FromDcmtkTests.cpp --- a/UnitTestsSources/FromDcmtkTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/FromDcmtkTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -149,15 +149,15 @@ Toolbox::DecodeDataUriScheme(m, c, s); ASSERT_EQ("image/png", m); - ASSERT_EQ(116, c.size()); + ASSERT_EQ(116u, c.size()); std::string cc; Toolbox::DecodeBase64(cc, c); PngReader reader; reader.ReadFromMemory(cc); - ASSERT_EQ(5, reader.GetHeight()); - ASSERT_EQ(5, reader.GetWidth()); + ASSERT_EQ(5u, reader.GetHeight()); + ASSERT_EQ(5u, reader.GetWidth()); ASSERT_EQ(PixelFormat_RGBA32, reader.GetFormat()); ParsedDicomFile o; diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/MemoryCacheTests.cpp --- a/UnitTestsSources/MemoryCacheTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/MemoryCacheTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -291,5 +291,5 @@ } } - ASSERT_EQ(2, count); + ASSERT_EQ(2u, count); } diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/MultiThreadingTests.cpp --- a/UnitTestsSources/MultiThreadingTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/MultiThreadingTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -237,7 +237,7 @@ IServerCommand::ListOfStrings l; scheduler.SubmitAndWait(l, job); - ASSERT_EQ(2, l.size()); + ASSERT_EQ(2u, l.size()); ASSERT_EQ(42 * 2 * 3, boost::lexical_cast(l.front())); ASSERT_EQ(42 * 2 * 3 * 4 * 5, boost::lexical_cast(l.back())); diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/PngTests.cpp --- a/UnitTestsSources/PngTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/PngTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -122,17 +122,17 @@ TEST(PngWriter, EndToEnd) { Orthanc::PngWriter w; - int width = 256; - int height = 256; - int pitch = width * 2 + 16; + unsigned int width = 256; + unsigned int height = 256; + unsigned int pitch = width * 2 + 16; std::vector image(height * pitch); int v = 0; - for (int y = 0; y < height; y++) + for (unsigned int y = 0; y < height; y++) { uint16_t *p = reinterpret_cast(&image[0] + y * pitch); - for (int x = 0; x < width; x++, p++, v++) + for (unsigned int x = 0; x < width; x++, p++, v++) { *p = v; } @@ -150,11 +150,11 @@ ASSERT_EQ(r.GetHeight(), height); v = 0; - for (int y = 0; y < height; y++) + for (unsigned int y = 0; y < height; y++) { const uint16_t *p = reinterpret_cast((const uint8_t*) r.GetConstBuffer() + y * r.GetPitch()); ASSERT_EQ(p, r.GetConstRow(y)); - for (int x = 0; x < width; x++, p++, v++) + for (unsigned int x = 0; x < width; x++, p++, v++) { ASSERT_EQ(*p, v); } @@ -173,11 +173,11 @@ ASSERT_EQ(r2.GetHeight(), height); v = 0; - for (int y = 0; y < height; y++) + for (unsigned int y = 0; y < height; y++) { const uint16_t *p = reinterpret_cast((const uint8_t*) r2.GetConstBuffer() + y * r2.GetPitch()); ASSERT_EQ(p, r2.GetConstRow(y)); - for (int x = 0; x < width; x++, p++, v++) + for (unsigned int x = 0; x < width; x++, p++, v++) { ASSERT_EQ(*p, v); } diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/RestApiTests.cpp --- a/UnitTestsSources/RestApiTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/RestApiTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -78,13 +78,13 @@ TEST(RestApi, ChunkedBuffer) { ChunkedBuffer b; - ASSERT_EQ(0, b.GetNumBytes()); + ASSERT_EQ(0u, b.GetNumBytes()); b.AddChunk("hello", 5); - ASSERT_EQ(5, b.GetNumBytes()); + ASSERT_EQ(5u, b.GetNumBytes()); b.AddChunk("world", 5); - ASSERT_EQ(10, b.GetNumBytes()); + ASSERT_EQ(10u, b.GetNumBytes()); std::string s; b.Flatten(s); diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/ServerIndexTests.cpp --- a/UnitTestsSources/ServerIndexTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/ServerIndexTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -193,7 +193,7 @@ { DatabaseWrapper* sqlite = dynamic_cast(index_.get()); sqlite->GetChildren(j, id); - ASSERT_EQ(0, j.size()); + ASSERT_EQ(0u, j.size()); break; } @@ -212,7 +212,7 @@ { DatabaseWrapper* sqlite = dynamic_cast(index_.get()); sqlite->GetChildren(j, id); - ASSERT_EQ(1, j.size()); + ASSERT_EQ(1u, j.size()); ASSERT_EQ(expected, j.front()); break; } @@ -234,7 +234,7 @@ { DatabaseWrapper* sqlite = dynamic_cast(index_.get()); sqlite->GetChildren(j, id); - ASSERT_EQ(2, j.size()); + ASSERT_EQ(2u, j.size()); ASSERT_TRUE((expected1 == j.front() && expected2 == j.back()) || (expected1 == j.back() && expected2 == j.front())); break; @@ -755,7 +755,7 @@ std::map instanceMetadata; ServerIndex::MetadataMap metadata; ASSERT_EQ(StoreStatus_Success, index.Store(instanceMetadata, instance, attachments, "", metadata)); - ASSERT_EQ(2, instanceMetadata.size()); + ASSERT_EQ(2u, instanceMetadata.size()); ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_RemoteAet) != instanceMetadata.end()); ASSERT_TRUE(instanceMetadata.find(MetadataType_Instance_ReceptionDate) != instanceMetadata.end()); diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/UnitTestsMain.cpp --- a/UnitTestsSources/UnitTestsMain.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/UnitTestsMain.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -666,15 +666,15 @@ std::vector t; Toolbox::TokenizeString(t, "", ','); - ASSERT_EQ(1, t.size()); + ASSERT_EQ(1u, t.size()); ASSERT_EQ("", t[0]); Toolbox::TokenizeString(t, "abc", ','); - ASSERT_EQ(1, t.size()); + ASSERT_EQ(1u, t.size()); ASSERT_EQ("abc", t[0]); Toolbox::TokenizeString(t, "ab,cd,ef,", ','); - ASSERT_EQ(4, t.size()); + ASSERT_EQ(4u, t.size()); ASSERT_EQ("ab", t[0]); ASSERT_EQ("cd", t[1]); ASSERT_EQ("ef", t[2]); diff -r e460341872dc -r 9f66a12eb8fc UnitTestsSources/VersionsTests.cpp --- a/UnitTestsSources/VersionsTests.cpp Tue Aug 04 14:14:17 2015 +0200 +++ b/UnitTestsSources/VersionsTests.cpp Tue Aug 04 14:47:35 2015 +0200 @@ -59,7 +59,7 @@ TEST(Versions, Png) { ASSERT_EQ(PNG_LIBPNG_VER_MAJOR * 10000 + PNG_LIBPNG_VER_MINOR * 100 + PNG_LIBPNG_VER_RELEASE, - png_access_version_number()); + static_cast(png_access_version_number())); } TEST(Versions, SQLite)