summaryrefslogtreecommitdiff
path: root/main/tests
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-06-26 15:08:25 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-06-26 15:08:25 +0200
commit4e5310cc60dc17e5ef09e57115ca8236544679e4 (patch)
tree894c5070a709198ed994db7c7d0c0e124abbc9e5 /main/tests
parent5c66771e3ebccdfec55bb94ea521d2f24cb6200a (diff)
Some code changed with Clang-Tidy
Diffstat (limited to 'main/tests')
-rw-r--r--main/tests/test_gdscript.cpp4
-rw-r--r--main/tests/test_physics.cpp1
-rw-r--r--main/tests/test_string.cpp6
3 files changed, 5 insertions, 6 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp
index 87bd640001..e82af93293 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -911,7 +911,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String
if (incr == 0) {
ERR_EXPLAIN("unhandled opcode: " + itos(code[ip]));
- ERR_BREAK(incr == 0);
+ ERR_BREAK(true);
}
ip += incr;
@@ -974,7 +974,7 @@ MainLoop *test(TestType p_type) {
if (tk.get_token() == GDScriptTokenizer::TK_IDENTIFIER)
text = "'" + tk.get_token_identifier() + "' (identifier)";
else if (tk.get_token() == GDScriptTokenizer::TK_CONSTANT) {
- Variant c = tk.get_token_constant();
+ const Variant &c = tk.get_token_constant();
if (c.get_type() == Variant::STRING)
text = "\"" + String(c) + "\"";
else
diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp
index 84f504a78d..6850c4d88a 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -329,7 +329,6 @@ public:
make_grid(5, 5, 2.5, 1, gxf);
test_fall();
quit = false;
- return;
}
virtual bool iteration(float p_time) {
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp
index a107fd738f..05df888f40 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -57,7 +57,7 @@ bool test_2() {
OS::get_singleton()->print("\n\nTest 2: Assign from string (operator=)\n");
String s = "Dolly";
- String t = s;
+ const String &t = s;
OS::get_singleton()->print("\tExpected: Dolly\n");
OS::get_singleton()->print("\tResulted: %ls\n", t.c_str());
@@ -70,7 +70,7 @@ bool test_3() {
OS::get_singleton()->print("\n\nTest 3: Assign from c-string (copycon)\n");
String s("Sheep");
- String t(s);
+ const String &t(s);
OS::get_singleton()->print("\tExpected: Sheep\n");
OS::get_singleton()->print("\tResulted: %ls\n", t.c_str());
@@ -1062,7 +1062,7 @@ bool test_33() {
OS::get_singleton()->print("\n\nTest 33: parse_utf8(null, -1)\n");
String empty;
- return empty.parse_utf8(NULL, -1) == true;
+ return empty.parse_utf8(NULL, -1);
}
bool test_34() {