Loading automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -57,11 +57,11 @@ public: }; }; TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) { TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) { void* raw = valuePool->obtain(VehiclePropertyType::INT32).get(); auto value = valuePool->obtain(VehiclePropertyType::INT32); // At this point, v1 should be recycled and the only object in the pool. // At this point, v1 should be recycled and the only object in the pool. ASSERT_EQ(raw, valuePool->obtain(VehiclePropertyType::INT32).get()); ASSERT_EQ(value.get(), valuePool->obtain(VehiclePropertyType::INT32).get()); // Obtaining value of another type - should return a new object // Obtaining value of another type - should return a new object ASSERT_NE(raw, valuePool->obtain(VehiclePropertyType::FLOAT).get()); ASSERT_NE(value.get(), valuePool->obtain(VehiclePropertyType::FLOAT).get()); ASSERT_EQ(3u, stats->Obtained); ASSERT_EQ(3u, stats->Obtained); ASSERT_EQ(2u, stats->Created); ASSERT_EQ(2u, stats->Created); Loading Loading
automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -57,11 +57,11 @@ public: }; }; TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) { TEST_F(VehicleObjectPoolTest, valuePoolBasicCorrectness) { void* raw = valuePool->obtain(VehiclePropertyType::INT32).get(); auto value = valuePool->obtain(VehiclePropertyType::INT32); // At this point, v1 should be recycled and the only object in the pool. // At this point, v1 should be recycled and the only object in the pool. ASSERT_EQ(raw, valuePool->obtain(VehiclePropertyType::INT32).get()); ASSERT_EQ(value.get(), valuePool->obtain(VehiclePropertyType::INT32).get()); // Obtaining value of another type - should return a new object // Obtaining value of another type - should return a new object ASSERT_NE(raw, valuePool->obtain(VehiclePropertyType::FLOAT).get()); ASSERT_NE(value.get(), valuePool->obtain(VehiclePropertyType::FLOAT).get()); ASSERT_EQ(3u, stats->Obtained); ASSERT_EQ(3u, stats->Obtained); ASSERT_EQ(2u, stats->Created); ASSERT_EQ(2u, stats->Created); Loading