summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-07 14:39:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-07 16:15:18 +0200
commit11518665b773e057ec1f3741276e46b0794a229e (patch)
tree586b3ccdb7446b0aaa8f12d631bbfefc8c08e529 /tests
parentd6d8cb1a171b0aa74bc54e615e7c1e068af5a5d8 (diff)
downloadredot-engine-11518665b773e057ec1f3741276e46b0794a229e.tar.gz
Codestyle: Don't use auto where not warranted
We allow using auto for lambdas or complex macros where a return type may change based on the parameters. But where the type is clear, we should be explicit. Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/core/variant/test_dictionary.h2
-rw-r--r--tests/scene/test_arraymesh.h2
-rw-r--r--tests/servers/rendering/test_shader_preprocessor.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/core/variant/test_dictionary.h b/tests/core/variant/test_dictionary.h
index 4571de6487..5bc56075da 100644
--- a/tests/core/variant/test_dictionary.h
+++ b/tests/core/variant/test_dictionary.h
@@ -90,7 +90,7 @@ TEST_CASE("[Dictionary] Assignment using bracket notation ([])") {
CHECK(int(map[false]) == 128);
// Ensure read-only maps aren't modified by non-existing keys.
- const auto length = map.size();
+ const int length = map.size();
map.make_read_only();
CHECK(int(map["This key does not exist"].get_type()) == Variant::NIL);
CHECK(map.size() == length);
diff --git a/tests/scene/test_arraymesh.h b/tests/scene/test_arraymesh.h
index 0e97e7d75f..1623b41300 100644
--- a/tests/scene/test_arraymesh.h
+++ b/tests/scene/test_arraymesh.h
@@ -195,7 +195,7 @@ TEST_CASE("[SceneTree][ArrayMesh] Surface metadata tests.") {
}
SUBCASE("Returns correct format for the mesh") {
- auto format = RS::ARRAY_FORMAT_BLEND_SHAPE_MASK | RS::ARRAY_FORMAT_TEX_UV | RS::ARRAY_FORMAT_INDEX;
+ int format = RS::ARRAY_FORMAT_BLEND_SHAPE_MASK | RS::ARRAY_FORMAT_TEX_UV | RS::ARRAY_FORMAT_INDEX;
CHECK((mesh->surface_get_format(0) & format) != 0);
CHECK((mesh->surface_get_format(1) & format) != 0);
}
diff --git a/tests/servers/rendering/test_shader_preprocessor.h b/tests/servers/rendering/test_shader_preprocessor.h
index d65eb522e8..c8c143641b 100644
--- a/tests/servers/rendering/test_shader_preprocessor.h
+++ b/tests/servers/rendering/test_shader_preprocessor.h
@@ -66,7 +66,7 @@ String remove_spaces(String &p_str) {
for (int n = 0; n < p_str.size(); n++) {
// These test cases only use ASCII.
- auto c = static_cast<unsigned char>(p_str[n]);
+ unsigned char c = static_cast<unsigned char>(p_str[n]);
if (std::isblank(c)) {
has_removed = true;
} else {
@@ -92,7 +92,7 @@ String remove_spaces(String &p_str) {
String compact_spaces(String &p_str) {
Vector<String> lines = p_str.split("\n", false);
erase_all_empty(lines);
- for (auto &line : lines) {
+ for (String &line : lines) {
line = remove_spaces(line);
}
return String("\n").join(lines);