Skip to content

Commit

Permalink
Add unittest for ImageData::load with and without file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Jul 20, 2024
1 parent 17f3c0a commit 4cdab26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/unittest/ImageDataTest.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2023 Jan Niklas Hasse <[email protected]>
// Copyright 2023-2024 Jan Niklas Hasse <[email protected]>
// For conditions of distribution and use, see copyright notice in LICENSE.txt

#include "../jngl/ImageData.hpp"
#include "Fixture.hpp"

#include <boost/ut.hpp>

Expand All @@ -25,6 +24,8 @@ boost::ut::suite _ = [] {
} catch (std::runtime_error& e) {
expect(eq(e.what(), std::string("File not found: foo.webp")));
}
expect(eq(jngl::ImageData::load("../data/jngl.webp")->getImageWidth(), 600));
expect(eq(jngl::ImageData::load("../data/jngl")->getImageHeight(), 300));
};
};
} // namespace

0 comments on commit 4cdab26

Please sign in to comment.