summaryrefslogtreecommitdiffstats
path: root/o3d/core
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/core')
-rw-r--r--o3d/core/cross/bitmap.cc1
-rw-r--r--o3d/core/cross/bitmap_test.cc107
-rw-r--r--o3d/core/cross/buffer_test.cc26
-rw-r--r--o3d/core/cross/client_test.cc10
-rw-r--r--o3d/core/cross/counter_test.cc10
-rw-r--r--o3d/core/cross/curve_test.cc30
-rw-r--r--o3d/core/cross/effect_test.cc1
-rw-r--r--o3d/core/cross/element_test.cc10
-rw-r--r--o3d/core/cross/field_test.cc6
-rw-r--r--o3d/core/cross/gl/texture_gl.cc14
-rw-r--r--o3d/core/cross/message_queue.cc7
-rw-r--r--o3d/core/cross/message_queue_test.cc28
-rw-r--r--o3d/core/cross/object_base_test.cc2
-rw-r--r--o3d/core/cross/param_array_test.cc20
-rw-r--r--o3d/core/cross/param_object_test.cc36
-rw-r--r--o3d/core/cross/param_test.cc36
-rw-r--r--o3d/core/cross/primitive_test.cc4
-rw-r--r--o3d/core/cross/render_node_test.cc4
-rw-r--r--o3d/core/cross/shape_test.cc4
-rw-r--r--o3d/core/cross/skin_test.cc38
-rw-r--r--o3d/core/cross/smart_ptr_test.cc2
-rw-r--r--o3d/core/cross/stream_bank_test.cc2
-rw-r--r--o3d/core/cross/stream_test.cc2
-rw-r--r--o3d/core/cross/transform_test.cc35
-rw-r--r--o3d/core/cross/vector_map_test.cc36
-rw-r--r--o3d/core/cross/vertex_source_test.cc16
26 files changed, 246 insertions, 241 deletions
diff --git a/o3d/core/cross/bitmap.cc b/o3d/core/cross/bitmap.cc
index 3c5f610..35dc34211 100644
--- a/o3d/core/cross/bitmap.cc
+++ b/o3d/core/cross/bitmap.cc
@@ -832,7 +832,6 @@ bool Bitmap::ScaleUpToPOT(unsigned int width,
uint8 *dst,
int dst_pitch) {
DCHECK(CheckImageDimensions(width, height));
- unsigned int components = 0;
switch (format) {
case Texture::XRGB8:
case Texture::ARGB8:
diff --git a/o3d/core/cross/bitmap_test.cc b/o3d/core/cross/bitmap_test.cc
index 3fe8be0..36f474c 100644
--- a/o3d/core/cross/bitmap_test.cc
+++ b/o3d/core/cross/bitmap_test.cc
@@ -363,9 +363,9 @@ TEST_F(BitmapTest, LoadTGAFile24bit) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, ktga256x256_24bit_BGRX));
}
@@ -378,9 +378,9 @@ TEST_F(BitmapTest, LoadTGAFile32bit) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::ARGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, ktga256x256_32bit_BGRA));
}
@@ -405,9 +405,9 @@ TEST_F(BitmapTest, LoadJPEGFile) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kjpg256x256_BGRX));
}
@@ -429,9 +429,9 @@ TEST_F(BitmapTest, LoadPNGFile24bit) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kpng256x256_24bit_BGRX));
}
@@ -445,9 +445,9 @@ TEST_F(BitmapTest, LoadPNGFile24bitInterlaced) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kpng256x256_24bit_interlaced_BGRX));
}
@@ -459,9 +459,9 @@ TEST_F(BitmapTest, LoadPNGFile32bit) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::ARGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kpng256x256_32bit_BGRA));
}
@@ -475,9 +475,9 @@ TEST_F(BitmapTest, LoadPNGFile8bitPalette) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kpng256x256_8bit_palette_BGRX));
}
@@ -491,9 +491,9 @@ TEST_F(BitmapTest, LoadPNGFile4bitPalette) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::XRGB8, bitmap->format());
- EXPECT_EQ(20, bitmap->width());
- EXPECT_EQ(14, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(20U, bitmap->width());
+ EXPECT_EQ(14U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kpng20x14_4bit_palette_BGRX));
}
@@ -519,9 +519,9 @@ TEST_F(BitmapTest, LoadPNGFile8bitPaletteAlpha) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::ARGB8, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
}
*/
@@ -534,9 +534,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT1) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT1, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kdxt1_256x256));
}
@@ -550,9 +550,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT1Alpha) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT1, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kdxt1_256x256_alpha));
}
@@ -566,9 +566,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT1Mipmap) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT1, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(9, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(9U, bitmap->num_mipmaps());
for (unsigned int i = 0; i < bitmap->num_mipmaps(); ++i) {
EXPECT_TRUE(bitmap->GetMipData(i) != NULL);
}
@@ -585,9 +585,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT3) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT3, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kdxt3_256x256_alpha));
}
@@ -601,9 +601,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT3Mipmap) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT3, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(9, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(9U, bitmap->num_mipmaps());
for (unsigned int i = 0; i < bitmap->num_mipmaps(); ++i) {
EXPECT_TRUE(bitmap->GetMipData(i) != NULL);
}
@@ -620,9 +620,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT5) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT5, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(1, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(1U, bitmap->num_mipmaps());
EXPECT_TRUE(TestBitmapData(*bitmap, kdxt5_256x256_alpha));
}
@@ -636,9 +636,9 @@ TEST_F(BitmapTest, LoadDDSFileDXT5Mipmap) {
EXPECT_TRUE(bitmap->image_data() != NULL);
EXPECT_FALSE(bitmap->is_cubemap());
EXPECT_EQ(Texture::DXT5, bitmap->format());
- EXPECT_EQ(256, bitmap->width());
- EXPECT_EQ(256, bitmap->height());
- EXPECT_EQ(9, bitmap->num_mipmaps());
+ EXPECT_EQ(256U, bitmap->width());
+ EXPECT_EQ(256U, bitmap->height());
+ EXPECT_EQ(9U, bitmap->num_mipmaps());
for (unsigned int i = 0; i < bitmap->num_mipmaps(); ++i) {
EXPECT_TRUE(bitmap->GetMipData(i) != NULL);
}
@@ -688,10 +688,9 @@ static const unsigned char kMipmapDataPOT[] = {
TEST_F(BitmapTest, GenerateMipmapsPOT) {
const unsigned int kWidth = 4;
const unsigned int kHeight = 4;
- const unsigned int kComponents = 4;
const Texture::Format format = Texture::ARGB8;
unsigned int mipmaps = Bitmap::GetMipMapCount(kWidth, kHeight);
- EXPECT_EQ(3, mipmaps);
+ EXPECT_EQ(3U, mipmaps);
unsigned int size = Bitmap::GetMipChainSize(kWidth, kHeight, format, mipmaps);
ASSERT_EQ(sizeof(kMipmapDataPOT), size);
scoped_array<unsigned char> data(new unsigned char[size]);
@@ -746,10 +745,9 @@ static const unsigned char kMipmapDataNPOT[] = {
TEST_F(BitmapTest, GenerateMipmapsNPOT) {
const unsigned int kWidth = 7;
const unsigned int kHeight = 7;
- const unsigned int kComponents = 4;
const Texture::Format format = Texture::ARGB8;
unsigned int mipmaps = Bitmap::GetMipMapCount(kWidth, kHeight);
- EXPECT_EQ(3, mipmaps);
+ EXPECT_EQ(3U, mipmaps);
unsigned int size = Bitmap::GetMipChainSize(kWidth, kHeight, format, mipmaps);
ASSERT_EQ(sizeof(kMipmapDataNPOT), size);
scoped_array<unsigned char> data(new unsigned char[size]);
@@ -831,11 +829,10 @@ static const unsigned char kScaleUPDataPOT[] = {
TEST_F(BitmapTest, ScaleUpToPOT) {
const unsigned int kWidth = 3;
const unsigned int kHeight = 3;
- const unsigned int kComponents = 4;
const unsigned int kPOTWidth = Bitmap::GetPOTSize(kWidth);
- ASSERT_EQ(kPOTWidth, 4);
+ ASSERT_EQ(kPOTWidth, 4U);
const unsigned int kPOTHeight = Bitmap::GetPOTSize(kHeight);
- ASSERT_EQ(kPOTHeight, 4);
+ ASSERT_EQ(kPOTHeight, 4U);
const Texture::Format format = Texture::ARGB8;
unsigned int src_size = Bitmap::GetBufferSize(kWidth, kHeight, format);
ASSERT_EQ(sizeof(kScaleUPDataNPOT), src_size);
diff --git a/o3d/core/cross/buffer_test.cc b/o3d/core/cross/buffer_test.cc
index 7e4561e..469df99 100644
--- a/o3d/core/cross/buffer_test.cc
+++ b/o3d/core/cross/buffer_test.cc
@@ -112,10 +112,10 @@ TEST_F(BufferTest, TestBasic) {
const FieldRefArray& fields = buffer->fields();
// Verify initial state.
ASSERT_TRUE(buffer->IsA(Buffer::GetApparentClass()));
- EXPECT_EQ(buffer->num_elements(), 0);
- EXPECT_EQ(fields.size(), 0);
- EXPECT_EQ(buffer->stride(), 0);
- EXPECT_EQ(buffer->GetSizeInBytes(), 0);
+ EXPECT_EQ(buffer->num_elements(), 0U);
+ EXPECT_EQ(fields.size(), 0U);
+ EXPECT_EQ(buffer->stride(), 0U);
+ EXPECT_EQ(buffer->GetSizeInBytes(), 0U);
}
// Test create fields and putting something in
@@ -140,12 +140,12 @@ TEST_F(BufferTest, CreateFields) {
Field::Ref field_1 = Field::Ref(buffer->CreateField(
FloatField::GetApparentClass(),
kNumComponents1));
- EXPECT_EQ(fields.size(), 1);
+ EXPECT_EQ(fields.size(), 1U);
EXPECT_EQ(field_1, fields[0].Get());
- EXPECT_EQ(field_1->offset(), 0);
+ EXPECT_EQ(field_1->offset(), 0U);
EXPECT_EQ(buffer->stride(), kSize1);
EXPECT_EQ(buffer->total_components(), kNumComponents1);
- EXPECT_EQ(buffer->GetSizeInBytes(), 0);
+ EXPECT_EQ(buffer->GetSizeInBytes(), 0U);
EXPECT_TRUE(ChangeCountChanged(&change_count, buffer));
// Allocate some elements.
@@ -258,10 +258,10 @@ TEST_F(BufferTest, ReshuffleFields) {
Field::Ref field_2 = Field::Ref(buffer->CreateField(
FloatField::GetApparentClass(),
kNumComponents2));
- EXPECT_EQ(fields.size(), 2);
+ EXPECT_EQ(fields.size(), 2U);
EXPECT_EQ(field_1, fields[0].Get());
EXPECT_EQ(field_2, fields[1].Get());
- EXPECT_EQ(field_1->offset(), 0);
+ EXPECT_EQ(field_1->offset(), 0U);
EXPECT_EQ(field_2->offset(), kSize1);
EXPECT_EQ(buffer->stride(), kSize1 + kSize2);
EXPECT_EQ(buffer->total_components(), kNumComponents1 + kNumComponents2);
@@ -290,9 +290,9 @@ TEST_F(BufferTest, ReshuffleFields) {
// Check deleting a field
buffer->RemoveField(field_1);
EXPECT_TRUE(field_1->buffer() == NULL);
- EXPECT_EQ(fields.size(), 1);
+ EXPECT_EQ(fields.size(), 1U);
EXPECT_EQ(field_2, fields[0].Get());
- EXPECT_EQ(field_2->offset(), 0);
+ EXPECT_EQ(field_2->offset(), 0U);
EXPECT_EQ(buffer->stride(), kSize2);
EXPECT_EQ(buffer->total_components(), kNumComponents2);
EXPECT_EQ(buffer->GetSizeInBytes(), kSize2 * kNumElements);
@@ -477,7 +477,7 @@ TEST_F(BufferTest, TestVertexBufferFromRawData) {
stream.WriteLittleEndianInt32(kNumElements);
// Make note of stream position at end of header
- size_t data_start_position = stream.GetStreamPosition();
+ stream.GetStreamPosition();
// Write out the data for each field
@@ -541,7 +541,7 @@ TEST_F(BufferTest, TestVertexBufferFromRawData) {
// Check that the field that was originally created to verify that setting
// the buffer from raw data would remove any existing fields was in fact
// removed.
- EXPECT_EQ(3, buffer->fields().size());
+ EXPECT_EQ(3U, buffer->fields().size());
float buffer_float_data[kNumElements * 3];
uint32 buffer_int_data[kNumElements * 2];
diff --git a/o3d/core/cross/client_test.cc b/o3d/core/cross/client_test.cc
index b572c57..ac6e853 100644
--- a/o3d/core/cross/client_test.cc
+++ b/o3d/core/cross/client_test.cc
@@ -140,7 +140,7 @@ TEST_F(ClientBasic, GetBuffers) {
b3->set_name("buffer3");
std::vector<Buffer*> buffers = object_manager_->Get<Buffer>("buffer1");
- EXPECT_EQ(2, buffers.size());
+ EXPECT_EQ(2U, buffers.size());
std::vector<Buffer*>::const_iterator pos;
EXPECT_TRUE((pos = find(buffers.begin(), buffers.end(), b1)) !=
buffers.end());
@@ -182,7 +182,7 @@ TEST_F(ClientBasic, GetEffects) {
e3->set_name("effect3");
EffectArray effects = object_manager_->Get<Effect>("effect1");
- EXPECT_EQ(2, effects.size());
+ EXPECT_EQ(2U, effects.size());
EffectArray::const_iterator pos;
EXPECT_TRUE((pos = find(effects.begin(), effects.end(), e1)) !=
effects.end());
@@ -295,17 +295,17 @@ TEST_F(ClientTree, GetById) {
// Tests GetByName
TEST_F(ClientTree, GetByName) {
TransformArray transforms = object_manager_->Get<Transform>("t3");
- EXPECT_EQ(1, transforms.size());
+ EXPECT_EQ(1U, transforms.size());
EXPECT_TRUE(transforms[0] == t3_);
transforms = object_manager_->Get<Transform>("t5");
- EXPECT_EQ(0, transforms.size());
+ EXPECT_EQ(0U, transforms.size());
// Add one more transform with the name "t3"
Transform* t3_new = pack()->Create<Transform>();
t3_new->set_name("t3");
transforms = object_manager_->Get<Transform>("t3");
- EXPECT_EQ(2, transforms.size());
+ EXPECT_EQ(2U, transforms.size());
TransformArray::const_iterator pos;
EXPECT_TRUE((pos = find(transforms.begin(),
transforms.end(),
diff --git a/o3d/core/cross/counter_test.cc b/o3d/core/cross/counter_test.cc
index 188cfb1..814328a 100644
--- a/o3d/core/cross/counter_test.cc
+++ b/o3d/core/cross/counter_test.cc
@@ -252,7 +252,7 @@ TEST_F(CounterTest, AddRemoveGetCallback) {
counter->AddCallback(2.0f, test2);
counter->AddCallback(1.0f, test1);
// Check that both got added.
- ASSERT_EQ(counters.size(), 2);
+ ASSERT_EQ(counters.size(), 2U);
iter = counters.begin();
EXPECT_EQ(iter->count(), 1.0f);
++iter;
@@ -261,7 +261,7 @@ TEST_F(CounterTest, AddRemoveGetCallback) {
// Check that adding one at the same time removes the other
counter->AddCallback(2.0f, test1);
EXPECT_TRUE(test2_deleted);
- ASSERT_EQ(counters.size(), 2);
+ ASSERT_EQ(counters.size(), 2U);
// Check that removing a non-existant callback fails.
EXPECT_FALSE(counter->RemoveCallback(3.0f));
@@ -269,12 +269,12 @@ TEST_F(CounterTest, AddRemoveGetCallback) {
// Check that removing one of the duplicated callbacks does not remove the
// other.
EXPECT_TRUE(counter->RemoveCallback(1.0f));
- ASSERT_EQ(counters.size(), 1);
+ ASSERT_EQ(counters.size(), 1U);
EXPECT_FALSE(test1_deleted);
// Check that removing final callback deletes the callback.
EXPECT_TRUE(counter->RemoveCallback(2.0f));
- ASSERT_EQ(counters.size(), 0);
+ ASSERT_EQ(counters.size(), 0U);
EXPECT_TRUE(test1_deleted);
EXPECT_FALSE(counter->RemoveCallback(2.0f));
@@ -611,7 +611,7 @@ TEST_F(CounterTest, AddRemoveGetCallback) {
// Check RemoveAllCallbacks.
counter->RemoveAllCallbacks();
- EXPECT_EQ(counters.size(), 0);
+ EXPECT_EQ(counters.size(), 0U);
EXPECT_TRUE(test1_deleted);
EXPECT_TRUE(test2_deleted);
EXPECT_TRUE(test3_deleted);
diff --git a/o3d/core/cross/curve_test.cc b/o3d/core/cross/curve_test.cc
index e1e25d6..d1de1f2 100644
--- a/o3d/core/cross/curve_test.cc
+++ b/o3d/core/cross/curve_test.cc
@@ -145,24 +145,24 @@ TEST_F(CurveTest, CreateKeyRemoveKey) {
ASSERT_TRUE(bezier_key != NULL);
const CurveKeyRefArray& keys = curve->keys();
- EXPECT_EQ(keys.size(), 3);
+ EXPECT_EQ(keys.size(), 3U);
EXPECT_TRUE(KeyInKeys(step_key, keys));
EXPECT_TRUE(KeyInKeys(linear_key, keys));
EXPECT_TRUE(KeyInKeys(bezier_key, keys));
step_key->Destroy();
- EXPECT_EQ(keys.size(), 2);
+ EXPECT_EQ(keys.size(), 2U);
EXPECT_FALSE(KeyInKeys(step_key, keys));
EXPECT_TRUE(KeyInKeys(linear_key, keys));
EXPECT_TRUE(KeyInKeys(bezier_key, keys));
bezier_key->Destroy();
- EXPECT_EQ(keys.size(), 1);
+ EXPECT_EQ(keys.size(), 1U);
EXPECT_TRUE(KeyInKeys(linear_key, keys));
EXPECT_FALSE(KeyInKeys(bezier_key, keys));
linear_key->Destroy();
- EXPECT_EQ(keys.size(), 0);
+ EXPECT_EQ(keys.size(), 0U);
}
// Tests ResortKeys and IsDiscontinuous
@@ -185,7 +185,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
ASSERT_TRUE(key4 != NULL);
const CurveKeyRefArray& keys = curve->keys();
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
key1->SetInput(1.0f);
key2->SetInput(2.0f);
@@ -193,7 +193,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(4.0f);
EXPECT_FALSE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key2);
EXPECT_EQ(keys[2], key3);
@@ -202,7 +202,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(0.0f);
EXPECT_FALSE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key4);
EXPECT_EQ(keys[1], key1);
EXPECT_EQ(keys[2], key2);
@@ -211,7 +211,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(2.5f);
EXPECT_FALSE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key2);
EXPECT_EQ(keys[2], key4);
@@ -222,7 +222,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(2.0f);
EXPECT_TRUE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key2);
EXPECT_EQ(keys[2], key4);
@@ -230,7 +230,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(1.5f); // should move it before key2
EXPECT_FALSE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key4);
EXPECT_EQ(keys[2], key2);
@@ -238,7 +238,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key4->SetInput(2.0f); // should still be before key2.
EXPECT_TRUE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 4);
+ EXPECT_EQ(keys.size(), 4U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key4);
EXPECT_EQ(keys[2], key2);
@@ -247,7 +247,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
CurveKey* key5 = curve->Create<LinearCurveKey>();
CurveKey* key6 = curve->Create<LinearCurveKey>();
EXPECT_TRUE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 6);
+ EXPECT_EQ(keys.size(), 6U);
EXPECT_EQ(keys[0], key5);
EXPECT_EQ(keys[1], key6);
EXPECT_EQ(keys[2], key1);
@@ -260,7 +260,7 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key5->SetInput(5.0f);
key6->SetInput(5.0f);
EXPECT_TRUE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- EXPECT_EQ(keys.size(), 6);
+ EXPECT_EQ(keys.size(), 6U);
EXPECT_EQ(keys[0], key1);
EXPECT_EQ(keys[1], key4);
EXPECT_EQ(keys[2], key2);
@@ -274,11 +274,11 @@ TEST_F(CurveTest, ResortKeysDiscontinuous) {
key3->SetInput(3.0f);
key4->SetInput(4.0f);
EXPECT_FALSE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
- CurveKey* stepkey1 = curve->Create<StepCurveKey>();
+ curve->Create<StepCurveKey>();
EXPECT_TRUE(curve->IsDiscontinuous()); // causes keys to be re-sorted.
// Try all step keys.
- CurveKey* stepkey2 = curve->Create<StepCurveKey>();
+ curve->Create<StepCurveKey>();
key1->Destroy();
key2->Destroy();
key3->Destroy();
diff --git a/o3d/core/cross/effect_test.cc b/o3d/core/cross/effect_test.cc
index b3a245c..b1361fb 100644
--- a/o3d/core/cross/effect_test.cc
+++ b/o3d/core/cross/effect_test.cc
@@ -252,7 +252,6 @@ TEST_F(EffectTest, CreateAndDestroyEffect) {
ASSERT_TRUE(color != NULL);
ASSERT_TRUE(index != NULL);
- void* vbuffer = NULL;
Field* vertex_field = verts->CreateField(FloatField::GetApparentClass(),
arraysize(kVertexBlock[0]));
ASSERT_TRUE(vertex_field != NULL);
diff --git a/o3d/core/cross/element_test.cc b/o3d/core/cross/element_test.cc
index ed546503f..954dd8b 100644
--- a/o3d/core/cross/element_test.cc
+++ b/o3d/core/cross/element_test.cc
@@ -141,12 +141,12 @@ TEST_F(ElementTest, DrawElement) {
ASSERT_TRUE(draw_element2 != NULL);
// Check there are no draw elements.
- EXPECT_EQ(element->GetDrawElementRefs().size(), 0);
+ EXPECT_EQ(element->GetDrawElementRefs().size(), 0U);
element->AddDrawElement(draw_element1);
// Check it's been added.
- EXPECT_EQ(element->GetDrawElementRefs().size(), 1);
+ EXPECT_EQ(element->GetDrawElementRefs().size(), 1U);
EXPECT_EQ(element->GetDrawElements()[0], draw_element1);
// Check removing something else fails
@@ -156,7 +156,7 @@ TEST_F(ElementTest, DrawElement) {
EXPECT_TRUE(element->RemoveDrawElement(draw_element1));
// Check it's been removed.
- EXPECT_EQ(element->GetDrawElementRefs().size(), 0);
+ EXPECT_EQ(element->GetDrawElementRefs().size(), 0U);
// Check removing it twice fails.
EXPECT_FALSE(element->RemoveDrawElement(draw_element1));
@@ -225,8 +225,8 @@ static void CreateCube(Pack* pack, Primitive** primitive_pointer) {
primitive->set_number_vertices(8);
EXPECT_EQ(primitive->primitive_type(), o3d::Primitive::TRIANGLELIST);
- EXPECT_EQ(primitive->number_primitives(), 12);
- EXPECT_EQ(primitive->number_vertices(), 8);
+ EXPECT_EQ(primitive->number_primitives(), 12U);
+ EXPECT_EQ(primitive->number_vertices(), 8U);
*primitive_pointer = primitive;
}
diff --git a/o3d/core/cross/field_test.cc b/o3d/core/cross/field_test.cc
index 6340f30..0f8afce 100644
--- a/o3d/core/cross/field_test.cc
+++ b/o3d/core/cross/field_test.cc
@@ -174,7 +174,7 @@ TEST_F(FieldTest, TestBasic) {
// Check things are as expected.
EXPECT_EQ(field_1->num_components(), kNumComponents);
- EXPECT_EQ(field_1->offset(), 0);
+ EXPECT_EQ(field_1->offset(), 0U);
EXPECT_EQ(field_1->size(),
field_1->num_components() * field_1->GetFieldComponentSize());
EXPECT_EQ(field_1->buffer(), buffer());
@@ -194,7 +194,7 @@ TEST_F(FieldTest, TestBasic) {
buffer()->CreateField(FloatField::GetApparentClass(), kNumComponents));
ASSERT_FALSE(field_2_ref.IsNull());
Field* field_2 = field_2_ref.Get();
- EXPECT_EQ(field_1->offset(), 0);
+ EXPECT_EQ(field_1->offset(), 0U);
EXPECT_EQ(field_2->offset(), field_1->size());
EXPECT_EQ(field_2->buffer(), buffer());
EXPECT_EQ(buffer()->num_elements(), kNumElements);
@@ -202,7 +202,7 @@ TEST_F(FieldTest, TestBasic) {
// Check if we remove the first field the second field gets updated correctly.
buffer()->RemoveField(field_1);
EXPECT_TRUE(field_1->buffer() == NULL);
- EXPECT_EQ(field_2->offset(), 0);
+ EXPECT_EQ(field_2->offset(), 0U);
// Check we can't create a field of 0 components.
EXPECT_TRUE(buffer()->CreateField(FloatField::GetApparentClass(), 0) ==
diff --git a/o3d/core/cross/gl/texture_gl.cc b/o3d/core/cross/gl/texture_gl.cc
index 3972a50..05acd38 100644
--- a/o3d/core/cross/gl/texture_gl.cc
+++ b/o3d/core/cross/gl/texture_gl.cc
@@ -435,7 +435,8 @@ void Texture2DGL::SetRect(int level,
GLenum gl_format = GLFormatFromO3DFormat(format(), &gl_internal_format,
&gl_data_type);
if (gl_format) {
- if (src_pitch == Bitmap::GetMipChainSize(src_width, 1, format(), 1)) {
+ if ((unsigned)src_pitch == Bitmap::GetMipChainSize(src_width, 1,
+ format(), 1)) {
glTexSubImage2D(GL_TEXTURE_2D, level,
dst_left, dst_top,
src_width, src_height,
@@ -443,7 +444,8 @@ void Texture2DGL::SetRect(int level,
gl_data_type,
src_data);
} else {
- for (int yy = 0; yy < src_height; ++yy) {
+ int limit = src_height;
+ for (int yy = 0; yy < limit; ++yy) {
glTexSubImage2D(GL_TEXTURE_2D, level,
dst_left, dst_top + yy,
src_width, 1,
@@ -488,7 +490,7 @@ bool Texture2DGL::Lock(int level, void** data, int* pitch) {
}
*data = backing_bitmap_->GetMipData(level);
unsigned int mip_width = Bitmap::GetMipDimension(level, width());
- unsigned int mip_height = Bitmap::GetMipDimension(level, height());
+
if (!IsCompressed()) {
*pitch = Bitmap::GetMipChainSize(mip_width, 1,format(), 1);
} else {
@@ -815,7 +817,8 @@ void TextureCUBEGL::SetRect(TextureCUBE::CubeFace face,
&gl_data_type);
int gl_face = kCubemapFaceList[face];
if (gl_format) {
- if (src_pitch == Bitmap::GetMipChainSize(src_width, 1, format(), 1)) {
+ if (static_cast<unsigned>(src_pitch) ==
+ Bitmap::GetMipChainSize(src_width, 1, format(), 1)) {
glTexSubImage2D(gl_face, level,
dst_left, dst_top,
src_width, src_height,
@@ -823,7 +826,8 @@ void TextureCUBEGL::SetRect(TextureCUBE::CubeFace face,
gl_data_type,
src_data);
} else {
- for (int yy = 0; yy < src_height; ++yy) {
+ int limit = src_height;
+ for (int yy = 0; yy < limit; ++yy) {
glTexSubImage2D(gl_face, level,
dst_left, dst_top + yy,
src_width, 1,
diff --git a/o3d/core/cross/message_queue.cc b/o3d/core/cross/message_queue.cc
index a7ff10f..f77d019 100644
--- a/o3d/core/cross/message_queue.cc
+++ b/o3d/core/cross/message_queue.cc
@@ -595,8 +595,9 @@ bool MessageQueue::ProcessUpdateTexture2D(ConnectedClient* client,
unsigned int mip_height =
Bitmap::GetMipDimension(level, texture_object->height());
- if (number_of_bytes != Bitmap::GetMipChainSize(mip_width, mip_height,
- texture_object->format(), 1)) {
+ if (static_cast<unsigned>(number_of_bytes) !=
+ Bitmap::GetMipChainSize(mip_width, mip_height,
+ texture_object->format(), 1)) {
O3D_ERROR(service_locator_)
<< "texture_size does not match size of texture level ("
<< offset << " + " << number_of_bytes << " > " << info->size_;
@@ -718,7 +719,7 @@ bool MessageQueue::ProcessUnregisterSharedMemory(ConnectedClient* client,
bool res = client->UnregisterSharedMemory(buffer_id);
SendBooleanResponse(client->client_handle(), res);
- return true;
+ return res;
}
diff --git a/o3d/core/cross/message_queue_test.cc b/o3d/core/cross/message_queue_test.cc
index 7fa43e6..3cefff0 100644
--- a/o3d/core/cross/message_queue_test.cc
+++ b/o3d/core/cross/message_queue_test.cc
@@ -227,8 +227,8 @@ class MessageQueueTest : public testing::Test {
private:
ServiceDependency<ObjectManager> object_manager_;
Pack *pack_;
- int num_socket_handles_;
nacl::Handle* socket_handles_;
+ int num_socket_handles_;
// This can't be part of SetUp since it needs to be called from each
// individual test.
@@ -381,7 +381,7 @@ bool TextureUpdateHelper::ReceiveBooleanResponse() {
int result = nacl::ReceiveDatagram(o3d_handle_, &header, 0);
- EXPECT_EQ(sizeof(response), result);
+ EXPECT_EQ(sizeof(response), static_cast<unsigned>(result));
if (result != sizeof(response)) {
return false;
}
@@ -479,8 +479,8 @@ bool TextureUpdateHelper::RequestSharedMemory(size_t requested_size,
// Send message.
int result = nacl::SendDatagram(o3d_handle_, &header, 0);
- EXPECT_EQ(vec.length, result);
- if (result != vec.length) {
+ EXPECT_EQ(vec.length, static_cast<unsigned>(result));
+ if (static_cast<unsigned>(result) != vec.length) {
return false;
}
@@ -499,8 +499,8 @@ bool TextureUpdateHelper::RequestSharedMemory(size_t requested_size,
EXPECT_LT(0, result);
EXPECT_EQ(0, header.flags & nacl::kMessageTruncated);
- EXPECT_EQ(1, header.handle_count);
- EXPECT_EQ(1, header.iov_length);
+ EXPECT_EQ(1U, header.handle_count);
+ EXPECT_EQ(1U, header.iov_length);
if (result < 0 ||
header.flags & nacl::kMessageTruncated ||
@@ -573,9 +573,9 @@ bool TextureUpdateHelper::RequestTextureUpdate(unsigned int texture_id,
// Send message.
int result = nacl::SendDatagram(o3d_handle_, &header, 0);
- EXPECT_EQ(vec.length, result);
+ EXPECT_EQ(vec.length, static_cast<unsigned>(result));
- if (result != vec.length) {
+ if (static_cast<unsigned>(result) != vec.length) {
return false;
}
@@ -621,8 +621,8 @@ int TextureUpdateHelper::RegisterSharedMemory(nacl::Handle shared_memory,
// Send message.
int result = nacl::SendDatagram(o3d_handle_, &header, 0);
- EXPECT_EQ(vec.length, result);
- if (result != vec.length) {
+ EXPECT_EQ(vec.length, static_cast<unsigned>(result));
+ if (static_cast<unsigned>(result) != vec.length) {
return -1;
}
@@ -639,10 +639,10 @@ int TextureUpdateHelper::RegisterSharedMemory(nacl::Handle shared_memory,
reply_header.handle_count = 0;
result = nacl::ReceiveDatagram(o3d_handle_, &reply_header, 0);
- EXPECT_EQ(shared_memory_vec.length, result);
+ EXPECT_EQ(shared_memory_vec.length, static_cast<unsigned>(result));
EXPECT_EQ(0, reply_header.flags & nacl::kMessageTruncated);
- EXPECT_EQ(0, reply_header.handle_count);
- EXPECT_EQ(1, reply_header.iov_length);
+ EXPECT_EQ(0U, reply_header.handle_count);
+ EXPECT_EQ(1U, reply_header.iov_length);
return shared_memory_id;
}
@@ -691,7 +691,7 @@ TEST_F(MessageQueueTest, Initialize) {
String socket_addr = message_queue->GetSocketAddress();
// Make sure the name starts with the expected value
- EXPECT_EQ(0, socket_addr.find("o3d"));
+ EXPECT_EQ(0U, socket_addr.find("o3d"));
delete message_queue;
}
diff --git a/o3d/core/cross/object_base_test.cc b/o3d/core/cross/object_base_test.cc
index eb4cc59..00edb75 100644
--- a/o3d/core/cross/object_base_test.cc
+++ b/o3d/core/cross/object_base_test.cc
@@ -64,7 +64,7 @@ void ObjectBaseTest::TearDown() {
}
TEST_F(ObjectBaseTest, ObjectIdOfNullIsZero) {
- ASSERT_EQ(0, GetObjectId(NULL));
+ ASSERT_EQ(0U, GetObjectId(NULL));
}
TEST_F(ObjectBaseTest, ObjectIdOfObjectIsReturned) {
diff --git a/o3d/core/cross/param_array_test.cc b/o3d/core/cross/param_array_test.cc
index d91e4e5..8be5801 100644
--- a/o3d/core/cross/param_array_test.cc
+++ b/o3d/core/cross/param_array_test.cc
@@ -81,7 +81,7 @@ TEST_F(ParamArrayTest, Basic) {
EXPECT_TRUE(param_array->IsA(NamedObject::GetApparentClass()));
// Check that it's size is zero.
- EXPECT_EQ(param_array->size(), 0);
+ EXPECT_EQ(param_array->size(), 0U);
}
// Test ParamArray::CreateParam
@@ -95,14 +95,14 @@ TEST_F(ParamArrayTest, CreateParam) {
ASSERT_TRUE(param_0 != NULL);
// Check the length.
- EXPECT_EQ(param_array->size(), 1);
+ EXPECT_EQ(param_array->size(), 1U);
// Add some more.
ParamFloat* param_5 = param_array->CreateParam<ParamFloat>(5);
ASSERT_TRUE(param_5 != NULL);
// Check that the params in between got created.
- EXPECT_EQ(param_array->size(), 6);
+ EXPECT_EQ(param_array->size(), 6U);
EXPECT_EQ(param_array->GetParam<ParamFloat>(0), param_0);
EXPECT_TRUE(param_array->GetParam<ParamFloat>(1) != NULL);
EXPECT_TRUE(param_array->GetParam<ParamFloat>(2) != NULL);
@@ -117,7 +117,7 @@ TEST_F(ParamArrayTest, CreateParam) {
ParamFloat* new_param_5 = param_array->CreateParam<ParamFloat>(5);
ASSERT_TRUE(new_param_5 != NULL);
- EXPECT_EQ(param_array->size(), 6);
+ EXPECT_EQ(param_array->size(), 6U);
EXPECT_EQ(param_array->GetParam<ParamFloat>(0), param_0);
EXPECT_TRUE(param_array->GetParam<ParamFloat>(1) != NULL);
EXPECT_TRUE(param_array->GetParam<ParamFloat>(2) != NULL);
@@ -141,7 +141,7 @@ TEST_F(ParamArrayTest, RemoveParam) {
ASSERT_TRUE(param_0 != NULL);
// Check the length.
- EXPECT_EQ(param_array->size(), 7);
+ EXPECT_EQ(param_array->size(), 7U);
// Get the last param so we can see that it moves.
ParamFloat* param;
@@ -151,27 +151,27 @@ TEST_F(ParamArrayTest, RemoveParam) {
// Remove a single param.
param_array->RemoveParams(1, 1);
- EXPECT_EQ(param_array->size(), 6);
+ EXPECT_EQ(param_array->size(), 6U);
EXPECT_EQ(param_array->GetParam<ParamFloat>(5), param);
// Remove a range
param_array->RemoveParams(1, 3);
- EXPECT_EQ(param_array->size(), 3);
+ EXPECT_EQ(param_array->size(), 3U);
EXPECT_EQ(param_array->GetParam<ParamFloat>(2), param);
// Remove the first param.
param_array->RemoveParams(0, 1);
- EXPECT_EQ(param_array->size(), 2);
+ EXPECT_EQ(param_array->size(), 2U);
EXPECT_EQ(param_array->GetParam<ParamFloat>(1), param);
// Remove the end param
param_array->RemoveParams(1, 1);
- EXPECT_EQ(param_array->size(), 1);
+ EXPECT_EQ(param_array->size(), 1U);
EXPECT_NE(param_array->GetParam<ParamFloat>(0), param);
// Remove the remaining param.
param_array->RemoveParams(0, 1);
- EXPECT_EQ(param_array->size(), 0);
+ EXPECT_EQ(param_array->size(), 0U);
EXPECT_TRUE(param_array->GetParam<ParamFloat>(0) == NULL);
}
diff --git a/o3d/core/cross/param_object_test.cc b/o3d/core/cross/param_object_test.cc
index 0fa912f..8eb03c0 100644
--- a/o3d/core/cross/param_object_test.cc
+++ b/o3d/core/cross/param_object_test.cc
@@ -305,13 +305,13 @@ TEST_F(ParamObjectTest, GetInputsForParamGetOutputsForParam) {
// Verify that FakeDivModParamOperationWorks.
operation->set_input1(19);
operation->set_input2(5);
- EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 0);
+ EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 0U);
EXPECT_EQ(operation->output1(), 3);
- EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 1);
+ EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 1U);
EXPECT_EQ(operation->output2(), 4);
// This should be 1 because calling operation->output1() should
// have updated output2().
- EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 1);
+ EXPECT_EQ(operation->NumberOfCallsToUpdateOutputs(), 1U);
// Now check GetInputs
Param* input1 = operation->GetUntypedParam(
@@ -330,36 +330,36 @@ TEST_F(ParamObjectTest, GetInputsForParamGetOutputsForParam) {
ParamVector params;
// There should be no params on the params
operation->GetInputsForParam(input1, &params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
operation->GetInputsForParam(input2, &params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
// There should be two params for each output.
operation->GetInputsForParam(output1, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(input1, params));
EXPECT_TRUE(ParamInParams(input2, params));
params.clear(); // make sure we are not just getting the same result.
operation->GetInputsForParam(output2, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(input1, params));
EXPECT_TRUE(ParamInParams(input2, params));
// Make sure we don't just add more params.
operation->GetInputsForParam(output2, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
// Check GetOutputs
operation->GetOutputsForParam(input1, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(output1, params));
EXPECT_TRUE(ParamInParams(output2, params));
operation->GetOutputsForParam(input2, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(output1, params));
EXPECT_TRUE(ParamInParams(output2, params));
operation->GetOutputsForParam(output1, &params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
operation->GetOutputsForParam(output2, &params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
// If we bind the output we should not get it as an input or an output.
Param* other = operation->CreateParam<ParamInteger>("other");
@@ -369,17 +369,17 @@ TEST_F(ParamObjectTest, GetInputsForParamGetOutputsForParam) {
// There should be two inputs for output1 but none for output2 since it is
// bound.
operation->GetInputsForParam(output1, &params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
operation->GetInputsForParam(output2, &params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
// There should only be 1 output for each of the inputs since output2 is
// no longer effected by the inputs.
operation->GetOutputsForParam(input1, &params);
- EXPECT_EQ(params.size(), 1);
+ EXPECT_EQ(params.size(), 1U);
EXPECT_TRUE(ParamInParams(output1, params));
operation->GetOutputsForParam(input2, &params);
- EXPECT_EQ(params.size(), 1);
+ EXPECT_EQ(params.size(), 1U);
EXPECT_TRUE(ParamInParams(output1, params));
}
@@ -433,7 +433,7 @@ TEST_F(ParamObjectTest, ImplicitCycles) {
// +-------------+
input_a_1->GetOutputs(&params);
- EXPECT_EQ(params.size(), 6);
+ EXPECT_EQ(params.size(), 6U);
EXPECT_TRUE(ParamInParams(output_a_1, params));
EXPECT_TRUE(ParamInParams(output_a_2, params));
EXPECT_TRUE(ParamInParams(output_b_1, params));
@@ -452,7 +452,7 @@ TEST_F(ParamObjectTest, ImplicitCycles) {
// IA2 OA2 IB2 OB2
output_b_1->GetInputs(&params);
- EXPECT_EQ(params.size(), 5);
+ EXPECT_EQ(params.size(), 5U);
EXPECT_TRUE(ParamInParams(input_a_1, params));
EXPECT_TRUE(ParamInParams(input_a_2, params));
EXPECT_TRUE(ParamInParams(input_b_1, params));
diff --git a/o3d/core/cross/param_test.cc b/o3d/core/cross/param_test.cc
index 5ae481f..3044acd 100644
--- a/o3d/core/cross/param_test.cc
+++ b/o3d/core/cross/param_test.cc
@@ -293,7 +293,7 @@ TEST_F(ParamBasic, OutputConnections) {
EXPECT_TRUE(param4->Bind(param1));
ParamVector out_connections = param1->output_connections();
- EXPECT_EQ(3, out_connections.size());
+ EXPECT_EQ(3U, out_connections.size());
EXPECT_EQ(param2->input_connection(), param1);
EXPECT_EQ(param3->input_connection(), param1);
@@ -311,7 +311,7 @@ TEST_F(ParamBasic, OutputConnections) {
// Remove one and check again
EXPECT_TRUE(param1->UnbindOutput(param3));
out_connections = param1->output_connections();
- EXPECT_EQ(2, out_connections.size());
+ EXPECT_EQ(2U, out_connections.size());
EXPECT_TRUE(find(out_connections.begin(), out_connections.end(), param2) !=
out_connections.end());
EXPECT_FALSE(find(out_connections.begin(), out_connections.end(), param3) !=
@@ -328,7 +328,7 @@ TEST_F(ParamBasic, OutputConnections) {
// and that output connections are updated
out_connections = param1->output_connections();
- EXPECT_EQ(1, out_connections.size());
+ EXPECT_EQ(1U, out_connections.size());
EXPECT_TRUE(find(out_connections.begin(), out_connections.end(), param2) !=
out_connections.end());
EXPECT_FALSE(find(out_connections.begin(), out_connections.end(), param3) !=
@@ -346,7 +346,7 @@ TEST_F(ParamBasic, UnbindInput) {
Param *source = param2->input_connection();
- EXPECT_TRUE(param2->input_connection() != NULL);
+ EXPECT_TRUE(source != NULL);
param2->UnbindInput();
@@ -622,26 +622,26 @@ TEST_F(ParamBindTest, GetInputsGetOuputs) {
ParamVector params;
float_param_1_->GetInputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_2_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_1_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
float_param_2_->GetInputs(&params);
- EXPECT_EQ(params.size(), 1);
+ EXPECT_EQ(params.size(), 1U);
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_2_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 1);
+ EXPECT_EQ(params.size(), 1U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
float_param_3_->GetInputs(&params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
float_param_3_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_2_, params));
@@ -651,32 +651,32 @@ TEST_F(ParamBindTest, GetInputsGetOuputs) {
// 3->2->1->3
float_param_1_->GetInputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_2_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_1_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_2_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_2_->GetInputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_2_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
float_param_3_->GetInputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_2_, params));
float_param_3_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_2_, params));
@@ -689,12 +689,12 @@ TEST_F(ParamBindTest, GetInputsGetOuputs) {
// +->3
float_param_3_->GetOutputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_1_, params));
EXPECT_TRUE(ParamInParams(float_param_2_, params));
float_param_1_->GetInputs(&params);
- EXPECT_EQ(params.size(), 2);
+ EXPECT_EQ(params.size(), 2U);
EXPECT_TRUE(ParamInParams(float_param_2_, params));
EXPECT_TRUE(ParamInParams(float_param_3_, params));
}
diff --git a/o3d/core/cross/primitive_test.cc b/o3d/core/cross/primitive_test.cc
index 757dcf0..661e0ab 100644
--- a/o3d/core/cross/primitive_test.cc
+++ b/o3d/core/cross/primitive_test.cc
@@ -100,8 +100,8 @@ TEST_F(PrimitiveTest, Basic) {
primitive->set_number_vertices(8);
EXPECT_EQ(primitive->primitive_type(), o3d::Primitive::TRIANGLELIST);
- EXPECT_EQ(primitive->number_primitives(), 12);
- EXPECT_EQ(primitive->number_vertices(), 8);
+ EXPECT_EQ(primitive->number_primitives(), 12U);
+ EXPECT_EQ(primitive->number_vertices(), 8U);
// Check getting the index buffer.
EXPECT_EQ(primitive->index_buffer(), index_buffer);
diff --git a/o3d/core/cross/render_node_test.cc b/o3d/core/cross/render_node_test.cc
index b572acc..256e3a2 100644
--- a/o3d/core/cross/render_node_test.cc
+++ b/o3d/core/cross/render_node_test.cc
@@ -95,12 +95,12 @@ TEST_F(RenderNodeBasicTest, SetParent) {
// Check that the node was added as a child to the parent transform
const RenderNodeArray children = parent->GetChildren();
- EXPECT_EQ(1, children.size());
+ EXPECT_EQ(1U, children.size());
EXPECT_EQ(render_node, children[0]);
// Check that SetParent(NULL) works properly too
render_node->SetParent(NULL);
- EXPECT_EQ(0, parent->GetChildren().size());
+ EXPECT_EQ(0U, parent->GetChildren().size());
}
TEST_F(RenderNodeBasicTest, SetParentCyclic) {
diff --git a/o3d/core/cross/shape_test.cc b/o3d/core/cross/shape_test.cc
index bc75244..08d14c3 100644
--- a/o3d/core/cross/shape_test.cc
+++ b/o3d/core/cross/shape_test.cc
@@ -71,7 +71,7 @@ TEST_F(ShapeTest, ElementsAccessorShouldReturnAllElements) {
shape->AddElement(element);
ElementArray elements = shape->GetElements();
- EXPECT_EQ(1, elements.size());
+ EXPECT_EQ(1U, elements.size());
EXPECT_EQ(element, elements[0]);
}
@@ -87,7 +87,7 @@ TEST_F(ShapeTest, ElementsAccessorShouldReplaceAllElements) {
shape->SetElements(elements);
elements = shape->GetElements();
- EXPECT_EQ(1, elements.size());
+ EXPECT_EQ(1U, elements.size());
EXPECT_EQ(element2, elements[0]);
}
} // namespace o3d
diff --git a/o3d/core/cross/skin_test.cc b/o3d/core/cross/skin_test.cc
index 5b1de83..ef4cd57 100644
--- a/o3d/core/cross/skin_test.cc
+++ b/o3d/core/cross/skin_test.cc
@@ -171,9 +171,9 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
// Check Highests are 0
const Skin::InfluencesArray& influences = skin->influences();
- ASSERT_EQ(influences.size(), 0);
- EXPECT_EQ(skin->GetHighestMatrixIndex(), 0);
- EXPECT_EQ(skin->GetHighestInfluences(), 0);
+ ASSERT_EQ(influences.size(), 0U);
+ EXPECT_EQ(skin->GetHighestMatrixIndex(), 0U);
+ EXPECT_EQ(skin->GetHighestInfluences(), 0U);
// Add some influences.
Skin::Influences no_influences;
@@ -188,7 +188,7 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
skin->SetVertexInfluences(4, influences_4);
// Check they got set.
- ASSERT_EQ(influences.size(), 5);
+ ASSERT_EQ(influences.size(), 5U);
EXPECT_TRUE(CompareInfluences(influences[0], influences_0));
EXPECT_TRUE(CompareInfluences(influences[1], no_influences));
EXPECT_TRUE(CompareInfluences(influences[2], no_influences));
@@ -196,8 +196,8 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
EXPECT_TRUE(CompareInfluences(influences[4], influences_4));
// Check the limits
- EXPECT_EQ(skin->GetHighestMatrixIndex(), 4);
- EXPECT_EQ(skin->GetHighestInfluences(), 2);
+ EXPECT_EQ(skin->GetHighestMatrixIndex(), 4U);
+ EXPECT_EQ(skin->GetHighestInfluences(), 2U);
// Add a new influence.
Skin::Influences influences_2;
@@ -207,7 +207,7 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
// Check they got set.
skin->SetVertexInfluences(2, influences_2);
- ASSERT_EQ(influences.size(), 5);
+ ASSERT_EQ(influences.size(), 5U);
EXPECT_TRUE(CompareInfluences(influences[0], influences_0));
EXPECT_TRUE(CompareInfluences(influences[1], no_influences));
EXPECT_TRUE(CompareInfluences(influences[2], influences_2));
@@ -215,12 +215,12 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
EXPECT_TRUE(CompareInfluences(influences[4], influences_4));
// Check the limits
- EXPECT_EQ(skin->GetHighestMatrixIndex(), 9);
- EXPECT_EQ(skin->GetHighestInfluences(), 3);
+ EXPECT_EQ(skin->GetHighestMatrixIndex(), 9U);
+ EXPECT_EQ(skin->GetHighestInfluences(), 3U);
// Add one past the end.
skin->SetVertexInfluences(6, influences_4);
- ASSERT_EQ(influences.size(), 7);
+ ASSERT_EQ(influences.size(), 7U);
EXPECT_TRUE(CompareInfluences(influences[0], influences_0));
EXPECT_TRUE(CompareInfluences(influences[1], no_influences));
EXPECT_TRUE(CompareInfluences(influences[2], influences_2));
@@ -230,8 +230,8 @@ TEST_F(SkinTest, GetSetVertexInfluence) {
EXPECT_TRUE(CompareInfluences(influences[6], influences_4));
// Check the limits
- EXPECT_EQ(skin->GetHighestMatrixIndex(), 9);
- EXPECT_EQ(skin->GetHighestInfluences(), 3);
+ EXPECT_EQ(skin->GetHighestMatrixIndex(), 9U);
+ EXPECT_EQ(skin->GetHighestInfluences(), 3U);
}
TEST_F(SkinTest, GetSetInverseBindPoseMatrices) {
@@ -240,7 +240,7 @@ TEST_F(SkinTest, GetSetInverseBindPoseMatrices) {
ASSERT_TRUE(skin != NULL);
const Skin::MatrixArray& matrices = skin->inverse_bind_pose_matrices();
- EXPECT_EQ(matrices.size(), 0);
+ EXPECT_EQ(matrices.size(), 0U);
Matrix4 matrix_2(Vector4(1.0f, 2.0f, 3.0f, 4.0f),
Vector4(2.0f, 3.0f, 4.0f, 6.0f),
@@ -252,13 +252,13 @@ TEST_F(SkinTest, GetSetInverseBindPoseMatrices) {
Vector4(4.0f, 5.0f, 6.0f, 8.0f));
skin->SetInverseBindPoseMatrix(2, matrix_2);
- EXPECT_EQ(matrices.size(), 3);
+ EXPECT_EQ(matrices.size(), 3U);
EXPECT_TRUE(CompareMatrix4s(matrices[0], Matrix4::identity()));
EXPECT_TRUE(CompareMatrix4s(matrices[1], Matrix4::identity()));
EXPECT_TRUE(CompareMatrix4s(matrices[2], matrix_2));
skin->SetInverseBindPoseMatrix(4, matrix_4);
- EXPECT_EQ(matrices.size(), 5);
+ EXPECT_EQ(matrices.size(), 5U);
EXPECT_TRUE(CompareMatrix4s(matrices[0], Matrix4::identity()));
EXPECT_TRUE(CompareMatrix4s(matrices[1], Matrix4::identity()));
EXPECT_TRUE(CompareMatrix4s(matrices[2], matrix_2));
@@ -407,7 +407,6 @@ TEST_F(SkinEvalTest, BindStreams) {
0.5f + 4.0f, 3.0f + 5.0f, 1.5f + 6.0f, 1.0f,
};
- const unsigned kStride = 10 * sizeof(vertices[0]);
const unsigned kNumElements = 3;
// Create the buffers.
@@ -668,7 +667,7 @@ TEST_F(SkinTest, SkinRawDataValid) {
// Write out some influence data
- const size_t kNumInfluences = 32;
+ const int kNumInfluences = 32;
write_stream.WriteLittleEndianInt32(kNumInfluences);
for (int i = 0; i < kNumInfluences; ++i) {
@@ -688,10 +687,11 @@ TEST_F(SkinTest, SkinRawDataValid) {
// Validate the influences
const Skin::InfluencesArray& influences_array = skin->influences();
- EXPECT_EQ(1, influences_array.size());
+ EXPECT_EQ(1U, influences_array.size());
const Skin::Influences& influences = influences_array[0];
- EXPECT_EQ(kNumInfluences, influences.size());
+ unsigned expected_count = kNumInfluences;
+ EXPECT_EQ(expected_count, influences.size());
for (Skin::Influences::size_type i = 0; i < influences.size(); ++i) {
const Skin::Influence &influence = influences[i];
diff --git a/o3d/core/cross/smart_ptr_test.cc b/o3d/core/cross/smart_ptr_test.cc
index e6d293a..feb45f7 100644
--- a/o3d/core/cross/smart_ptr_test.cc
+++ b/o3d/core/cross/smart_ptr_test.cc
@@ -108,7 +108,9 @@ TEST_F(SmartPtrTest, AssignmentRelease) {
SmartPointer<InstanceCount> smart_ptr1(new InstanceCount());
SmartPointer<InstanceCount> smart_ptr2(new InstanceCount());
InstanceCount *raw_ptr1 = smart_ptr1.Get();
+ EXPECT_TRUE(raw_ptr1 != NULL);
InstanceCount *raw_ptr2 = smart_ptr2.Get();
+ EXPECT_TRUE(raw_ptr2 != NULL);
// Validate that assignment destroys the previous instance.
smart_ptr2 = smart_ptr1;
diff --git a/o3d/core/cross/stream_bank_test.cc b/o3d/core/cross/stream_bank_test.cc
index a154df3..daee4ca 100644
--- a/o3d/core/cross/stream_bank_test.cc
+++ b/o3d/core/cross/stream_bank_test.cc
@@ -255,7 +255,7 @@ TEST_F(StreamBankTest, BindStream) {
3.0f));
// Check that UpdateOutputs only got called once.
- EXPECT_EQ(source->update_outputs_call_count(), 1);
+ EXPECT_EQ(source->update_outputs_call_count(), 1U);
}
} // namespace o3d
diff --git a/o3d/core/cross/stream_test.cc b/o3d/core/cross/stream_test.cc
index cfbacff..7f1a7de 100644
--- a/o3d/core/cross/stream_test.cc
+++ b/o3d/core/cross/stream_test.cc
@@ -91,7 +91,7 @@ TEST_F(StreamBasic, Constructor) {
FieldTest::Ref field(new FieldTest());
unsigned start_index = 1;
- unsigned semantic_index = 2;
+ int semantic_index = 2;
Stream::Semantic semantic = Stream::BINORMAL;
Stream stream(g_service_locator,
diff --git a/o3d/core/cross/transform_test.cc b/o3d/core/cross/transform_test.cc
index c7d9869..7ee4f23 100644
--- a/o3d/core/cross/transform_test.cc
+++ b/o3d/core/cross/transform_test.cc
@@ -286,13 +286,13 @@ TEST_F(TransformBasic, GetChildren) {
Transform* t2 = pack()->Create<Transform>();
Transform* t3 = pack()->Create<Transform>();
- EXPECT_EQ(0, transform_->GetChildren().size());
+ EXPECT_EQ(0U, transform_->GetChildren().size());
t2->SetParent(transform_);
- EXPECT_EQ(1, transform_->GetChildren().size());
+ EXPECT_EQ(1U, transform_->GetChildren().size());
t3->SetParent(transform_);
- EXPECT_EQ(2, transform_->GetChildren().size());
+ EXPECT_EQ(2U, transform_->GetChildren().size());
TransformArray children = transform_->GetChildren();
TransformArrayConstIterator pos = find(children.begin(), children.end(), t2);
@@ -334,7 +334,7 @@ TEST_F(TransformBasic, GetTransformsInTree) {
TransformArray transforms_in_tree(transform2_->GetTransformsInTree());
// Check that all of them are in the tree.
- EXPECT_EQ(transforms_in_tree.size(), 4);
+ EXPECT_EQ(transforms_in_tree.size(), 4U);
EXPECT_TRUE(std::find(transforms_in_tree.begin(),
transforms_in_tree.end(),
transform_) != transforms_in_tree.end());
@@ -352,7 +352,7 @@ TEST_F(TransformBasic, GetTransformsInTree) {
t3->SetParent(NULL);
transforms_in_tree = transform2_->GetTransformsInTree();
- EXPECT_EQ(transforms_in_tree.size(), 2);
+ EXPECT_EQ(transforms_in_tree.size(), 2U);
EXPECT_TRUE(std::find(transforms_in_tree.begin(),
transforms_in_tree.end(),
transform_) != transforms_in_tree.end());
@@ -373,9 +373,9 @@ TEST_F(TransformBasic, GetTransformsByNameInTree) {
SetupSimpleTree();
// Check that a transform is in there.
- EXPECT_EQ(transform2_->GetTransformsByNameInTree("t2").size(), 1);
+ EXPECT_EQ(transform2_->GetTransformsByNameInTree("t2").size(), 1U);
// Check that another transform is not in there.
- EXPECT_EQ(transform2_->GetTransformsByNameInTree("t3").size(), 0);
+ EXPECT_EQ(transform2_->GetTransformsByNameInTree("t3").size(), 0U);
}
// Tests AddShape, RemoveShape, GetShapes.
@@ -391,7 +391,7 @@ TEST_F(TransformBasic, AddShapeRemoveShapeGetShapes) {
// Check that they actually got added.
{
const ShapeRefArray& shapes = transform_->GetShapeRefs();
- EXPECT_EQ(shapes.size(), 2);
+ EXPECT_EQ(shapes.size(), 2U);
EXPECT_TRUE(std::find(shapes.begin(),
shapes.end(),
Shape::Ref(shape1)) != shapes.end());
@@ -406,7 +406,7 @@ TEST_F(TransformBasic, AddShapeRemoveShapeGetShapes) {
{
// check it got added.
ShapeArray shapes = transform_->GetShapes();
- EXPECT_EQ(shapes.size(), 3);
+ EXPECT_EQ(shapes.size(), 3U);
EXPECT_TRUE(std::find(shapes.begin(),
shapes.end(),
Shape::Ref(shape1)) != shapes.end());
@@ -435,7 +435,7 @@ TEST_F(TransformBasic,
transform_->SetShapes(shape_array);
shape_array = transform_->GetShapes();
- EXPECT_EQ(1, shape_array.size());
+ EXPECT_EQ(1U, shape_array.size());
EXPECT_EQ(shape2, shape_array[0]);
}
@@ -463,8 +463,8 @@ TEST_F(TransformBasic, CreateGroupDrawElements) {
transform2_->CreateDrawElements(pack(), material);
// Check that they got created correctly.
- EXPECT_EQ(primitive1->GetDrawElementRefs().size(), 2);
- EXPECT_EQ(primitive2->GetDrawElementRefs().size(), 2);
+ EXPECT_EQ(primitive1->GetDrawElementRefs().size(), 2U);
+ EXPECT_EQ(primitive2->GetDrawElementRefs().size(), 2U);
}
TEST_F(TransformBasic, GetConcreteInputsForParamGetConcreteOutputsForParam) {
@@ -500,7 +500,7 @@ TEST_F(TransformBasic, GetConcreteInputsForParamGetConcreteOutputsForParam) {
// Tests GetConcreteInputsForParam (because GetInputsForParam calles
// GetConcreteInputsForParam)
t1_world_matrix->GetInputs(&params);
- EXPECT_EQ(params.size(), 7);
+ EXPECT_EQ(params.size(), 7U);
EXPECT_TRUE(ParamInParams(t1_local_matrix, params));
EXPECT_TRUE(ParamInParams(t2_world_matrix, params));
EXPECT_TRUE(ParamInParams(t2_local_matrix, params));
@@ -510,19 +510,19 @@ TEST_F(TransformBasic, GetConcreteInputsForParamGetConcreteOutputsForParam) {
EXPECT_TRUE(ParamInParams(t4_local_matrix, params));
t1_local_matrix->GetInputs(&params);
- EXPECT_EQ(params.size(), 0);
+ EXPECT_EQ(params.size(), 0U);
// Tests GetConcreteOutputsForParam (because GetOutputsForParam calles
// GetConcreteOutputsForParam)
t4_local_matrix->GetOutputs(&params);
- EXPECT_EQ(params.size(), 4);
+ EXPECT_EQ(params.size(), 4U);
EXPECT_TRUE(ParamInParams(t1_world_matrix, params));
EXPECT_TRUE(ParamInParams(t2_world_matrix, params));
EXPECT_TRUE(ParamInParams(t3_world_matrix, params));
EXPECT_TRUE(ParamInParams(t4_world_matrix, params));
t4_world_matrix->GetOutputs(&params);
- EXPECT_EQ(params.size(), 3);
+ EXPECT_EQ(params.size(), 3U);
EXPECT_TRUE(ParamInParams(t1_world_matrix, params));
EXPECT_TRUE(ParamInParams(t2_world_matrix, params));
EXPECT_TRUE(ParamInParams(t3_world_matrix, params));
@@ -545,12 +545,15 @@ TEST_F(TransformBasic, ImplicitInputs) {
Param* t1_local_matrix = transform_->GetUntypedParam(
Transform::kLocalMatrixParamName);
+ EXPECT_TRUE(t1_local_matrix != NULL);
Param* t2_local_matrix = transform2_->GetUntypedParam(
Transform::kLocalMatrixParamName);
+ EXPECT_TRUE(t2_local_matrix != NULL);
Param* t3_local_matrix = t3->GetUntypedParam(
Transform::kLocalMatrixParamName);
Param* t4_local_matrix = t4->GetUntypedParam(
Transform::kLocalMatrixParamName);
+ EXPECT_TRUE(t4_local_matrix != NULL);
ParamMatrix4* t1_world_matrix = transform_->GetParam<ParamMatrix4>(
Transform::kWorldMatrixParamName);
Param* t2_world_matrix = transform2_->GetUntypedParam(
diff --git a/o3d/core/cross/vector_map_test.cc b/o3d/core/cross/vector_map_test.cc
index ffad0fe..7316a9c 100644
--- a/o3d/core/cross/vector_map_test.cc
+++ b/o3d/core/cross/vector_map_test.cc
@@ -47,12 +47,12 @@ TEST(VectorMapTest, General) {
the_map[0] = 5;
EXPECT_FALSE(the_map.empty());
- EXPECT_EQ(the_map.size(), 1);
+ EXPECT_EQ(the_map.size(), 1U);
the_map[9] = 2;
EXPECT_FALSE(the_map.empty());
- EXPECT_EQ(the_map.size(), 2);
+ EXPECT_EQ(the_map.size(), 2U);
EXPECT_EQ(the_map[9], 2);
EXPECT_EQ(the_map[0], 5);
@@ -77,7 +77,7 @@ TEST(VectorMapTest, General) {
EXPECT_EQ(the_map[1234], 90);
EXPECT_EQ(the_map[ 8], 23);
EXPECT_EQ(the_map[ -5], 6);
- EXPECT_EQ(the_map.size(), 5);
+ EXPECT_EQ(the_map.size(), 5U);
EXPECT_FALSE(the_map.empty());
iter = the_map.begin();
@@ -120,7 +120,7 @@ TEST(VectorMapTest, Insert) {
EXPECT_EQ(it->first, j);
EXPECT_EQ(it->second, j * 100);
}
- EXPECT_EQ(the_map.size(), i);
+ EXPECT_EQ(static_cast<int>(the_map.size()), i);
EXPECT_FALSE(the_map.empty());
}
}
@@ -171,7 +171,7 @@ TEST(VectorMapTest, InsertIfNotPresent) {
EXPECT_EQ(it->first, j);
EXPECT_EQ(it->second, j * 100);
}
- EXPECT_EQ(the_map.size(), i);
+ EXPECT_EQ(static_cast<int>(the_map.size()), i);
EXPECT_FALSE(the_map.empty());
}
}
@@ -188,7 +188,7 @@ TEST(VectorMapTest, Erase) {
EXPECT_EQ(the_map["monday" ], 1);
EXPECT_EQ(the_map["tuesday" ], 2);
EXPECT_EQ(the_map["wednesday"], 3);
- EXPECT_EQ(the_map.count("tuesday"), 1);
+ EXPECT_EQ(the_map.count("tuesday"), 1U);
iter = the_map.begin();
ASSERT_TRUE(iter != the_map.end());
@@ -212,12 +212,12 @@ TEST(VectorMapTest, Erase) {
EXPECT_TRUE(iter1 == iter2);
EXPECT_TRUE(iter == the_map.end());
- EXPECT_EQ(the_map.erase("tuesday"), 1);
+ EXPECT_EQ(the_map.erase("tuesday"), 1U);
EXPECT_EQ(the_map["monday" ], 1);
EXPECT_EQ(the_map["wednesday"], 3);
- EXPECT_EQ(the_map.count("tuesday"), 0);
- EXPECT_EQ(the_map.erase("tuesday"), 0);
+ EXPECT_EQ(the_map.count("tuesday"), 0U);
+ EXPECT_EQ(the_map.erase("tuesday"), 0U);
iter = the_map.begin();
ASSERT_TRUE(iter != the_map.end());
@@ -234,24 +234,24 @@ TEST(VectorMapTest, Erase) {
the_map["thursday"] = 4;
the_map["friday"] = 5;
- EXPECT_EQ(the_map.size(), 4);
+ EXPECT_EQ(the_map.size(), 4U);
EXPECT_FALSE(the_map.empty());
the_map["saturday"] = 6;
- EXPECT_EQ(the_map.count("friday"), 1);
- EXPECT_EQ(the_map.erase("friday"), 1);
- EXPECT_EQ(the_map.count("friday"), 0);
- EXPECT_EQ(the_map.erase("friday"), 0);
+ EXPECT_EQ(the_map.count("friday"), 1U);
+ EXPECT_EQ(the_map.erase("friday"), 1U);
+ EXPECT_EQ(the_map.count("friday"), 0U);
+ EXPECT_EQ(the_map.erase("friday"), 0U);
- EXPECT_EQ(the_map.size(), 4);
+ EXPECT_EQ(the_map.size(), 4U);
EXPECT_FALSE(the_map.empty());
- EXPECT_EQ(the_map.erase("monday"), 1);
- EXPECT_EQ(the_map.size(), 3);
+ EXPECT_EQ(the_map.erase("monday"), 1U);
+ EXPECT_EQ(the_map.size(), 3U);
EXPECT_FALSE(the_map.empty());
the_map.clear();
- EXPECT_EQ(the_map.size(), 0);
+ EXPECT_EQ(the_map.size(), 0U);
EXPECT_TRUE(the_map.empty());
}
diff --git a/o3d/core/cross/vertex_source_test.cc b/o3d/core/cross/vertex_source_test.cc
index cea3e2d..d190aa0 100644
--- a/o3d/core/cross/vertex_source_test.cc
+++ b/o3d/core/cross/vertex_source_test.cc
@@ -224,8 +224,8 @@ TEST_F(VertexSourceTest, BindStream) {
3.0f));
// Check that UpdateOutputs only got called once.
- EXPECT_EQ(destination->update_outputs_call_count(), 1);
- EXPECT_EQ(source->update_outputs_call_count(), 1);
+ EXPECT_EQ(destination->update_outputs_call_count(), 1U);
+ EXPECT_EQ(source->update_outputs_call_count(), 1U);
// Test that if we chain another VertexSource UpdateOutputs only gets called
// once.
@@ -271,15 +271,15 @@ TEST_F(VertexSourceTest, BindStream) {
3.0f));
// Check that UpdateOutputs only got called once.
- EXPECT_EQ(destination->update_outputs_call_count(), 2);
- EXPECT_EQ(source->update_outputs_call_count(), 2);
- EXPECT_EQ(source_b->update_outputs_call_count(), 1);
+ EXPECT_EQ(destination->update_outputs_call_count(), 2U);
+ EXPECT_EQ(source->update_outputs_call_count(), 2U);
+ EXPECT_EQ(source_b->update_outputs_call_count(), 1U);
// Test that if we ask again UpdateOutputs does not get called.
destination->UpdateStreams();
- EXPECT_EQ(destination->update_outputs_call_count(), 2);
- EXPECT_EQ(source->update_outputs_call_count(), 2);
- EXPECT_EQ(source_b->update_outputs_call_count(), 1);
+ EXPECT_EQ(destination->update_outputs_call_count(), 2U);
+ EXPECT_EQ(source->update_outputs_call_count(), 2U);
+ EXPECT_EQ(source_b->update_outputs_call_count(), 1U);
// Test that we can unbind.
EXPECT_TRUE(source->UnbindStream(Stream::POSITION, 0));