changeset 1492:9f66a12eb8fc

fix warnings for gcc 5
author jodogne
date Tue, 04 Aug 2015 14:47:35 +0200
parents e460341872dc
children 9a1c7293955b
files UnitTestsSources/DicomMapTests.cpp UnitTestsSources/FromDcmtkTests.cpp UnitTestsSources/MemoryCacheTests.cpp UnitTestsSources/MultiThreadingTests.cpp UnitTestsSources/PngTests.cpp UnitTestsSources/RestApiTests.cpp UnitTestsSources/ServerIndexTests.cpp UnitTestsSources/UnitTestsMain.cpp UnitTestsSources/VersionsTests.cpp
diffstat 9 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- 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<DicomMap> mm(m.Clone());
--- 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;
--- 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);
 }
--- 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<int>(l.front()));
   ASSERT_EQ(42 * 2 * 3 * 4 * 5, boost::lexical_cast<int>(l.back()));
 
--- 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<uint8_t> 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<uint16_t*>(&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 uint16_t*>((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 uint16_t*>((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);
       }
--- 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);
--- 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<DatabaseWrapper*>(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<DatabaseWrapper*>(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<DatabaseWrapper*>(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<MetadataType, std::string> 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());
 
--- 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<std::string> 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]);
--- 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<int>(png_access_version_number()));
 }
 
 TEST(Versions, SQLite)