diff --git a/src/AppGLFW.cpp b/src/AppGLFW.cpp index b2f2aa0..e5f2da0 100644 --- a/src/AppGLFW.cpp +++ b/src/AppGLFW.cpp @@ -207,6 +207,6 @@ void pixelarium::ui::AppGLFW::LoadImageProt() { this->logger_.Debug(std::format("{}: Creating image {}", __FUNCTION__, p)); - image_view_model_->AddImage(std::make_unique(p)); + last_id = image_view_model_->AddImage(std::make_unique(p)); } } diff --git a/tests/lib/resources/test_resource.cpp b/tests/lib/resources/test_resource.cpp index 8229df0..4cbf38d 100644 --- a/tests/lib/resources/test_resource.cpp +++ b/tests/lib/resources/test_resource.cpp @@ -102,17 +102,3 @@ TEST(ImageResourcePoolTest, TemplatedEnumerate) EXPECT_NE(std::find(found_ids.begin(), found_ids.end(), id1), found_ids.end()); EXPECT_NE(std::find(found_ids.begin(), found_ids.end(), id2), found_ids.end()); } - -TEST(ImageResourcePoolTest, TemplatedEnumerate) -{ - ImageResourcePool pool; - auto id1 = pool.SetResource(std::make_unique()); - auto id2 = pool.SetResource(std::make_unique()); - std::vector found_ids{}; - - pool.Enumerate([&found_ids](size_t id, const pixelarium::imaging::PixelariumImage& img) { found_ids.push_back(id); }); - - EXPECT_EQ(found_ids.size(), 2); - EXPECT_NE(std::find(found_ids.begin(), found_ids.end(), id1), found_ids.end()); - EXPECT_NE(std::find(found_ids.begin(), found_ids.end(), id2), found_ids.end()); -}