From e17cab1fbfd1a298ab8c02ede539b9fc9429c6ac Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 4 Aug 2023 19:32:33 -0600 Subject: [PATCH] Add tests for `sf::Texture::loadFromFile` --- test/Graphics/Texture.test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/Graphics/Texture.test.cpp b/test/Graphics/Texture.test.cpp index 7ea1ea96..4d280a95 100644 --- a/test/Graphics/Texture.test.cpp +++ b/test/Graphics/Texture.test.cpp @@ -54,6 +54,17 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests()) } } + SECTION("loadFromFile()") + { + sf::Texture texture; + REQUIRE(texture.loadFromFile("Graphics/sfml-logo-big.png")); + CHECK(texture.getSize() == sf::Vector2u(1001, 304)); + CHECK(!texture.isSmooth()); + CHECK(!texture.isSrgb()); + CHECK(!texture.isRepeated()); + CHECK(texture.getNativeHandle() != 0); + } + SECTION("Copy semantics") { constexpr std::uint8_t red[] = {0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF};