mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Add clang-tidy performance-*
checks
This commit is contained in:
parent
ea4c448a85
commit
cafaa1c153
@ -3,6 +3,7 @@ Checks: >
|
|||||||
clang-analyzer-*,
|
clang-analyzer-*,
|
||||||
misc-*,
|
misc-*,
|
||||||
modernize-*,
|
modernize-*,
|
||||||
|
performance-*,
|
||||||
portability-*,
|
portability-*,
|
||||||
readability-*,
|
readability-*,
|
||||||
-clang-analyzer-nullability.NullablePassedToNonnull,
|
-clang-analyzer-nullability.NullablePassedToNonnull,
|
||||||
@ -20,6 +21,8 @@ Checks: >
|
|||||||
-modernize-return-braced-init-list,
|
-modernize-return-braced-init-list,
|
||||||
-modernize-use-nodiscard,
|
-modernize-use-nodiscard,
|
||||||
-modernize-use-trailing-return-type,
|
-modernize-use-trailing-return-type,
|
||||||
|
-performance-inefficient-string-concatenation,
|
||||||
|
-performance-no-int-to-ptr,
|
||||||
-readability-braces-around-statements,
|
-readability-braces-around-statements,
|
||||||
-readability-container-contains,
|
-readability-container-contains,
|
||||||
-readability-convert-member-functions-to-static,
|
-readability-convert-member-functions-to-static,
|
||||||
|
@ -61,7 +61,7 @@ TEST_CASE("[Graphics] sf::Texture" * doctest::skip(skipDisplayTests))
|
|||||||
|
|
||||||
SUBCASE("Construction")
|
SUBCASE("Construction")
|
||||||
{
|
{
|
||||||
const sf::Texture textureCopy(texture);
|
const sf::Texture textureCopy(texture); // NOLINT(performance-unnecessary-copy-initialization)
|
||||||
REQUIRE(textureCopy.getSize() == sf::Vector2u(1, 2));
|
REQUIRE(textureCopy.getSize() == sf::Vector2u(1, 2));
|
||||||
CHECK(textureCopy.copyToImage().getPixel(sf::Vector2u(0, 1)) == sf::Color::Red);
|
CHECK(textureCopy.copyToImage().getPixel(sf::Vector2u(0, 1)) == sf::Color::Red);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ TEST_CASE("[Graphics] sf::VertexBuffer" * doctest::skip(true))
|
|||||||
|
|
||||||
SUBCASE("Construction")
|
SUBCASE("Construction")
|
||||||
{
|
{
|
||||||
const sf::VertexBuffer vertexBufferCopy(vertexBuffer);
|
const sf::VertexBuffer vertexBufferCopy(vertexBuffer); // NOLINT(performance-unnecessary-copy-initialization)
|
||||||
CHECK(vertexBufferCopy.getVertexCount() == 0);
|
CHECK(vertexBufferCopy.getVertexCount() == 0);
|
||||||
CHECK(vertexBufferCopy.getNativeHandle() == 0);
|
CHECK(vertexBufferCopy.getNativeHandle() == 0);
|
||||||
CHECK(vertexBufferCopy.getPrimitiveType() == sf::PrimitiveType::LineStrip);
|
CHECK(vertexBufferCopy.getPrimitiveType() == sf::PrimitiveType::LineStrip);
|
||||||
|
Loading…
Reference in New Issue
Block a user