summaryrefslogtreecommitdiff
path: root/main/tests/test_math.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/tests/test_math.cpp')
-rw-r--r--main/tests/test_math.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp
index fbd1aa275a..33589e37af 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -50,7 +50,6 @@
namespace TestMath {
class GetClassAndNamespace {
-
String code;
int idx;
int line;
@@ -77,12 +76,9 @@ class GetClassAndNamespace {
};
Token get_token() {
-
while (true) {
switch (code[idx]) {
-
case '\n': {
-
line++;
idx++;
break;
@@ -92,37 +88,30 @@ class GetClassAndNamespace {
} break;
case '{': {
-
idx++;
return TK_CURLY_BRACKET_OPEN;
};
case '}': {
-
idx++;
return TK_CURLY_BRACKET_CLOSE;
};
case '[': {
-
idx++;
return TK_BRACKET_OPEN;
};
case ']': {
-
idx++;
return TK_BRACKET_CLOSE;
};
case ':': {
-
idx++;
return TK_COLON;
};
case ',': {
-
idx++;
return TK_COMMA;
};
case '.': {
-
idx++;
return TK_PERIOD;
};
@@ -134,7 +123,6 @@ class GetClassAndNamespace {
continue;
} break;
case '/': {
-
switch (code[idx + 1]) {
case '*': { // block comment
@@ -145,7 +133,6 @@ class GetClassAndNamespace {
error = true;
return TK_ERROR;
} else if (code[idx] == '*' && code[idx + 1] == '/') {
-
idx += 2;
break;
} else if (code[idx] == '\n') {
@@ -174,7 +161,6 @@ class GetClassAndNamespace {
} break;
case '\'':
case '"': {
-
CharType begin_str = code[idx];
idx++;
String tk_string = String();
@@ -198,7 +184,6 @@ class GetClassAndNamespace {
CharType res = 0;
switch (next) {
-
case 'b':
res = 8;
break;
@@ -241,7 +226,6 @@ class GetClassAndNamespace {
} break;
default: {
-
if (code[idx] <= 32) {
idx++;
break;
@@ -262,11 +246,9 @@ class GetClassAndNamespace {
return TK_NUMBER;
} else if ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) {
-
String id;
while ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) {
-
id += code[idx];
idx++;
}
@@ -285,7 +267,6 @@ class GetClassAndNamespace {
public:
Error parse(const String &p_code, const String &p_known_class_name = String()) {
-
code = p_code;
idx = 0;
line = 0;
@@ -301,7 +282,6 @@ public:
int curly_stack = 0;
while (!error || tk != TK_EOF) {
-
if (tk == TK_BRACKET_OPEN) {
tk = get_token();
if (tk == TK_IDENTIFIER && String(value) == "ScriptClass") {
@@ -374,7 +354,6 @@ public:
};
void test_vec(Plane p_vec) {
-
CameraMatrix cm;
cm.set_perspective(45, 1, 0, 100);
Plane v0 = cm.xform4(p_vec);
@@ -413,7 +392,6 @@ uint32_t ihash3(uint32_t a) {
}
MainLoop *test() {
-
{
Vector<Vector3> points;
points.push_back(Vector3(0, 0, 0));
@@ -564,26 +542,22 @@ MainLoop *test() {
}
{
-
Vector<int> hashes;
List<StringName> tl;
ClassDB::get_class_list(&tl);
for (List<StringName>::Element *E = tl.front(); E; E = E->next()) {
-
Vector<uint8_t> m5b = E->get().operator String().md5_buffer();
hashes.push_back(hashes.size());
}
for (int i = nearest_shift(hashes.size()); i < 20; i++) {
-
bool success = true;
for (int s = 0; s < 10000; s++) {
Set<uint32_t> existing;
success = true;
for (int j = 0; j < hashes.size(); j++) {
-
uint32_t eh = ihash2(ihash3(hashes[j] + ihash(s) + s)) & ((1 << i) - 1);
if (existing.has(eh)) {
success = false;