summaryrefslogtreecommitdiffstats
path: root/tests/core
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/io/test_config_file.h10
-rw-r--r--tests/core/io/test_json.h4
-rw-r--r--tests/core/io/test_marshalls.h6
-rw-r--r--tests/core/io/test_packet_peer.h8
-rw-r--r--tests/core/io/test_pck_packer.h2
-rw-r--r--tests/core/math/test_quaternion.h2
-rw-r--r--tests/core/os/test_os.h4
-rw-r--r--tests/core/string/test_string.h93
-rw-r--r--tests/core/templates/test_list.h12
-rw-r--r--tests/core/test_time.h40
10 files changed, 97 insertions, 84 deletions
diff --git a/tests/core/io/test_config_file.h b/tests/core/io/test_config_file.h
index a669906bdb..c274972b1f 100644
--- a/tests/core/io/test_config_file.h
+++ b/tests/core/io/test_config_file.h
@@ -47,7 +47,7 @@ TEST_CASE("[ConfigFile] Parsing well-formatted files") {
name = "Unnamed Player"
tagline="Waiting
for
-Godot"
+Redot"
color =Color( 0, 0.5,1, 1) ; Inline comment
position= Vector2(
@@ -68,7 +68,7 @@ antiAliasing = false
String(config_file.get_value("player", "name")) == "Unnamed Player",
"Reading `player/name` should return the expected value.");
CHECK_MESSAGE(
- String(config_file.get_value("player", "tagline")) == "Waiting\nfor\nGodot",
+ String(config_file.get_value("player", "tagline")) == "Waiting\nfor\nRedot",
"Reading `player/tagline` should return the expected value.");
CHECK_MESSAGE(
Color(config_file.get_value("player", "color")).is_equal_approx(Color(0, 0.5, 1)),
@@ -96,7 +96,7 @@ TEST_CASE("[ConfigFile] Parsing malformatted file") {
[player]
name = "Unnamed Player"" ; Extraneous closing quote.
-tagline = "Waiting\nfor\nGodot"
+tagline = "Waiting\nfor\nRedot"
color = Color(0, 0.5, 1) ; Missing 4th parameter.
position = Vector2(
@@ -118,7 +118,7 @@ antialiasing = false ; Duplicate key.
TEST_CASE("[ConfigFile] Saving file") {
ConfigFile config_file;
config_file.set_value("player", "name", "Unnamed Player");
- config_file.set_value("player", "tagline", "Waiting\nfor\nGodot");
+ config_file.set_value("player", "tagline", "Waiting\nfor\nRedot");
config_file.set_value("player", "color", Color(0, 0.5, 1));
config_file.set_value("player", "position", Vector2(3, 4));
config_file.set_value("graphics", "antialiasing", true);
@@ -140,7 +140,7 @@ TEST_CASE("[ConfigFile] Saving file") {
name="Unnamed Player"
tagline="Waiting
for
-Godot"
+Redot"
color=Color(0, 0.5, 1, 1)
position=Vector2(3, 4)
diff --git a/tests/core/io/test_json.h b/tests/core/io/test_json.h
index bf2ed42740..ee1f2ad845 100644
--- a/tests/core/io/test_json.h
+++ b/tests/core/io/test_json.h
@@ -127,11 +127,11 @@ TEST_CASE("[JSON] Parsing arrays") {
TEST_CASE("[JSON] Parsing objects (dictionaries)") {
JSON json;
- json.parse(R"({"name": "Godot Engine", "is_free": true, "bugs": null, "apples": {"red": 500, "green": 0, "blue": -20}, "empty_object": {}})");
+ json.parse(R"({"name": "Redot Engine", "is_free": true, "bugs": null, "apples": {"red": 500, "green": 0, "blue": -20}, "empty_object": {}})");
const Dictionary dictionary = json.get_data();
CHECK_MESSAGE(
- dictionary["name"] == "Godot Engine",
+ dictionary["name"] == "Redot Engine",
"The parsed JSON should contain the expected values.");
CHECK_MESSAGE(
dictionary["is_free"],
diff --git a/tests/core/io/test_marshalls.h b/tests/core/io/test_marshalls.h
index de8d6e1406..a37bcea71d 100644
--- a/tests/core/io/test_marshalls.h
+++ b/tests/core/io/test_marshalls.h
@@ -141,13 +141,13 @@ TEST_CASE("[Marshalls] Floating point double precision decoding") {
}
TEST_CASE("[Marshalls] C string encoding") {
- char cstring[] = "Godot"; // 5 characters
+ char cstring[] = "Redot"; // 5 characters
uint8_t data[6];
int actual_size = encode_cstring(cstring, data);
CHECK(actual_size == 6);
- CHECK(data[0] == 'G');
- CHECK(data[1] == 'o');
+ CHECK(data[0] == 'R');
+ CHECK(data[1] == 'e');
CHECK(data[2] == 'd');
CHECK(data[3] == 'o');
CHECK(data[4] == 't');
diff --git a/tests/core/io/test_packet_peer.h b/tests/core/io/test_packet_peer.h
index 59c8dadad8..6c02177ee5 100644
--- a/tests/core/io/test_packet_peer.h
+++ b/tests/core/io/test_packet_peer.h
@@ -68,7 +68,7 @@ TEST_CASE("[PacketPeer][PacketPeerStream] Encode buffer max size") {
}
TEST_CASE("[PacketPeer][PacketPeerStream] Read a variant from peer") {
- String godot_rules = "Godot Rules!!!";
+ String godot_rules = "Redot Rules!!!";
Ref<StreamPeerBuffer> spb;
spb.instantiate();
@@ -95,7 +95,7 @@ TEST_CASE("[PacketPeer][PacketPeerStream] Read a variant from peer fails") {
}
TEST_CASE("[PacketPeer][PacketPeerStream] Put a variant to peer") {
- String godot_rules = "Godot Rules!!!";
+ String godot_rules = "Redot Rules!!!";
Ref<StreamPeerBuffer> spb;
spb.instantiate();
@@ -127,7 +127,7 @@ TEST_CASE("[PacketPeer][PacketPeerStream] Put a variant to peer out of memory fa
}
TEST_CASE("[PacketPeer][PacketPeerStream] Get packet buffer") {
- String godot_rules = "Godot Rules!!!";
+ String godot_rules = "Redot Rules!!!";
Ref<StreamPeerBuffer> spb;
spb.instantiate();
@@ -164,7 +164,7 @@ TEST_CASE("[PacketPeer][PacketPeerStream] Get packet buffer from an empty peer")
}
TEST_CASE("[PacketPeer][PacketPeerStream] Put packet buffer") {
- String godot_rules = "Godot Rules!!!";
+ String godot_rules = "Redot Rules!!!";
Ref<StreamPeerBuffer> spb;
spb.instantiate();
diff --git a/tests/core/io/test_pck_packer.h b/tests/core/io/test_pck_packer.h
index 7ef9451963..5368b1475c 100644
--- a/tests/core/io/test_pck_packer.h
+++ b/tests/core/io/test_pck_packer.h
@@ -111,7 +111,7 @@ TEST_CASE("[PCKPacker] Pack a PCK file with some files and directories") {
err == OK,
"The generated non-empty PCK file should be opened successfully.");
CHECK_MESSAGE(
- f->get_length() >= 18000,
+ f->get_length() >= 12000,
"The generated non-empty PCK file should be large enough to actually hold the contents specified above.");
CHECK_MESSAGE(
f->get_length() <= 27000,
diff --git a/tests/core/math/test_quaternion.h b/tests/core/math/test_quaternion.h
index 40db43b88b..bc86bf9ef6 100644
--- a/tests/core/math/test_quaternion.h
+++ b/tests/core/math/test_quaternion.h
@@ -292,7 +292,7 @@ TEST_CASE("[Quaternion] Product") {
// Test ZYX dynamic-axes since test data is available online.
// Rotate first about X axis, then new Y axis, then new Z axis.
- // (Godot uses YXZ Yaw-Pitch-Roll order).
+ // (Redot uses YXZ Yaw-Pitch-Roll order).
Quaternion q_yp = q_y * q_p;
CHECK(q_yp[0] == doctest::Approx(0.239118));
CHECK(q_yp[1] == doctest::Approx(0.369644));
diff --git a/tests/core/os/test_os.h b/tests/core/os/test_os.h
index 1e2f5e222b..7a2151e044 100644
--- a/tests/core/os/test_os.h
+++ b/tests/core/os/test_os.h
@@ -182,7 +182,7 @@ TEST_CASE("[OS] Execute") {
const Error err = OS::get_singleton()->execute("cmd", arguments, nullptr, &exit_code);
CHECK_MESSAGE(
err == OK,
- "(Running the command `cmd /C \"dir > NUL\"` returns the expected Godot error code (OK).");
+ "(Running the command `cmd /C \"dir > NUL\"` returns the expected Redot error code (OK).");
CHECK_MESSAGE(
exit_code == 0,
"Running the command `cmd /C \"dir > NUL\"` returns a zero (successful) exit code.");
@@ -194,7 +194,7 @@ TEST_CASE("[OS] Execute") {
const Error err = OS::get_singleton()->execute("sh", arguments, nullptr, &exit_code);
CHECK_MESSAGE(
err == OK,
- "(Running the command `sh -c \"ls > /dev/null\"` returns the expected Godot error code (OK).");
+ "(Running the command `sh -c \"ls > /dev/null\"` returns the expected Redot error code (OK).");
CHECK_MESSAGE(
exit_code == 0,
"Running the command `sh -c \"ls > /dev/null\"` returns a zero (successful) exit code.");
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h
index 8559737e74..b2b03110be 100644
--- a/tests/core/string/test_string.h
+++ b/tests/core/string/test_string.h
@@ -285,9 +285,9 @@ TEST_CASE("[String] Testing for empty string") {
}
TEST_CASE("[String] Contains") {
- String s = "C:\\Godot\\project\\string_test.tscn";
+ String s = "C:\\Redot\\project\\string_test.tscn";
CHECK(s.contains(":\\"));
- CHECK(s.contains("Godot"));
+ CHECK(s.contains("Redot"));
CHECK(s.contains(String("project\\string_test")));
CHECK(s.contains(String("\\string_test.tscn")));
@@ -298,9 +298,9 @@ TEST_CASE("[String] Contains") {
}
TEST_CASE("[String] Contains case insensitive") {
- String s = "C:\\Godot\\project\\string_test.tscn";
- CHECK(s.containsn("Godot"));
- CHECK(s.containsn("godot"));
+ String s = "C:\\Redot\\project\\string_test.tscn";
+ CHECK(s.containsn("Redot"));
+ CHECK(s.containsn("Redot"));
CHECK(s.containsn(String("Project\\string_test")));
CHECK(s.containsn(String("\\string_Test.tscn")));
@@ -1422,7 +1422,7 @@ TEST_CASE("[String] Checking string is empty when it should be") {
if (!success) {
state = false;
}
- String b = "Godot";
+ String b = "Redot";
success = b[b.size()] == 0;
if (!success) {
state = false;
@@ -1433,7 +1433,7 @@ TEST_CASE("[String] Checking string is empty when it should be") {
state = false;
}
- const String d = "Godot";
+ const String d = "Redot";
success = d[d.size()] == 0;
if (!success) {
state = false;
@@ -1559,7 +1559,7 @@ TEST_CASE("[String] Count and countn functionality") {
s = "TestTestTest";
MULTICHECK_STRING_EQ(s, count, "TestTest", 1);
- s = "TestGodotTestGodotTestGodot";
+ s = "TestRedotTestRedotTestRedot";
MULTICHECK_STRING_EQ(s, count, "Test", 3);
s = "TestTestTestTest";
@@ -1628,12 +1628,12 @@ TEST_CASE("[String] dedent") {
}
TEST_CASE("[String] Path functions") {
- static const char *path[8] = { "C:\\Godot\\project\\test.tscn", "/Godot/project/test.xscn", "../Godot/project/test.scn", "Godot\\test.doc", "C:\\test.", "res://test", "user://test", "/.test" };
- static const char *base_dir[8] = { "C:\\Godot\\project", "/Godot/project", "../Godot/project", "Godot", "C:\\", "res://", "user://", "/" };
- static const char *base_name[8] = { "C:\\Godot\\project\\test", "/Godot/project/test", "../Godot/project/test", "Godot\\test", "C:\\test", "res://test", "user://test", "/" };
+ static const char *path[8] = { "C:\\Redot\\project\\test.tscn", "/Redot/project/test.xscn", "../Redot/project/test.scn", "Redot\\test.doc", "C:\\test.", "res://test", "user://test", "/.test" };
+ static const char *base_dir[8] = { "C:\\Redot\\project", "/Redot/project", "../Redot/project", "Redot", "C:\\", "res://", "user://", "/" };
+ static const char *base_name[8] = { "C:\\Redot\\project\\test", "/Redot/project/test", "../Redot/project/test", "Redot\\test", "C:\\test", "res://test", "user://test", "/" };
static const char *ext[8] = { "tscn", "xscn", "scn", "doc", "", "", "", "test" };
static const char *file[8] = { "test.tscn", "test.xscn", "test.scn", "test.doc", "test.", "test", "test", ".test" };
- static const char *simplified[8] = { "C:/Godot/project/test.tscn", "/Godot/project/test.xscn", "../Godot/project/test.scn", "Godot/test.doc", "C:/test.", "res://test", "user://test", "/.test" };
+ static const char *simplified[8] = { "C:/Redot/project/test.tscn", "/Redot/project/test.xscn", "../Redot/project/test.scn", "Redot/test.doc", "C:/test.", "res://test", "user://test", "/.test" };
static const bool abs[8] = { true, true, false, false, true, true, true, true };
for (int i = 0; i < 8; i++) {
@@ -1666,8 +1666,8 @@ TEST_CASE("[String] hash") {
}
TEST_CASE("[String] uri_encode/unescape") {
- String s = "Godot Engine:'docs'";
- String t = "Godot%20Engine%3A%27docs%27";
+ String s = "Redot Engine:'docs'";
+ String t = "Redot%20Engine%3A%27docs%27";
String x1 = "T%C4%93%C5%A1t";
static const uint8_t u8str[] = { 0x54, 0xC4, 0x93, 0xC5, 0xA1, 0x74, 0x00 };
@@ -1794,20 +1794,32 @@ TEST_CASE("[String] Reverse") {
}
TEST_CASE("[String] SHA1/SHA256/MD5") {
- String s = "Godot";
- String sha1 = "a1e91f39b9fce6a9998b14bdbe2aa2b39dc2d201";
+ String s = "Redot";
+ String sha1 = "fa4e7bc6eda6baf3600e392f46be46f699bd5a8a";
static uint8_t sha1_buf[20] = {
- 0xA1, 0xE9, 0x1F, 0x39, 0xB9, 0xFC, 0xE6, 0xA9, 0x99, 0x8B, 0x14, 0xBD, 0xBE, 0x2A, 0xA2, 0xB3,
- 0x9D, 0xC2, 0xD2, 0x01
+ 0xFA, 0x4E, 0x7B, 0xC6,
+ 0xED, 0xA6, 0xBA, 0xF3,
+ 0x60, 0x0E, 0x39, 0x2F,
+ 0x46, 0xBE, 0x46, 0xF6,
+ 0x99, 0xBD, 0x5A, 0x8A
};
- String sha256 = "2a02b2443f7985d89d09001086ae3dcfa6eb0f55c6ef170715d42328e16e6cb8";
+ String sha256 = "5b33770f1e60d19c83ba6be484306fa1fcf5266e6ee8de2f4456483e92327c1a";
static uint8_t sha256_buf[32] = {
- 0x2A, 0x02, 0xB2, 0x44, 0x3F, 0x79, 0x85, 0xD8, 0x9D, 0x09, 0x00, 0x10, 0x86, 0xAE, 0x3D, 0xCF,
- 0xA6, 0xEB, 0x0F, 0x55, 0xC6, 0xEF, 0x17, 0x07, 0x15, 0xD4, 0x23, 0x28, 0xE1, 0x6E, 0x6C, 0xB8
+ 0x5B, 0x33, 0x77, 0x0F,
+ 0x1E, 0x60, 0xD1, 0x9C,
+ 0x83, 0xBA, 0x6B, 0xE4,
+ 0x84, 0x30, 0x6F, 0xA1,
+ 0xFC, 0xF5, 0x26, 0x6E,
+ 0x6E, 0xE8, 0xDE, 0x2F,
+ 0x44, 0x56, 0x48, 0x3E,
+ 0x92, 0x32, 0x7C, 0x1A
};
- String md5 = "4a336d087aeb0390da10ee2ea7cb87f8";
+ String md5 = "a417866a47d1710210ed143c47ad5e4d";
static uint8_t md5_buf[16] = {
- 0x4A, 0x33, 0x6D, 0x08, 0x7A, 0xEB, 0x03, 0x90, 0xDA, 0x10, 0xEE, 0x2E, 0xA7, 0xCB, 0x87, 0xF8
+ 0xA4, 0x17, 0x86, 0x6A,
+ 0x47, 0xD1, 0x71, 0x02,
+ 0x10, 0xED, 0x14, 0x3C,
+ 0x47, 0xAD, 0x5E, 0x4D
};
PackedByteArray buf = s.sha1_buffer();
@@ -2007,18 +2019,19 @@ TEST_CASE("[String][URL] Parse URL") {
CHECK_URL("https://www.example.com:8080/path/to/file.html#fragment", "https://", "www.example.com", 8080, "/path/to/file.html", "fragment", Error::OK);
// Valid URLs.
- CHECK_URL("https://godotengine.org", "https://", "godotengine.org", 0, "", "", Error::OK);
- CHECK_URL("https://godotengine.org/", "https://", "godotengine.org", 0, "/", "", Error::OK);
- CHECK_URL("godotengine.org/", "", "godotengine.org", 0, "/", "", Error::OK);
- CHECK_URL("HTTPS://godotengine.org/", "https://", "godotengine.org", 0, "/", "", Error::OK);
- CHECK_URL("https://GODOTENGINE.ORG/", "https://", "godotengine.org", 0, "/", "", Error::OK);
- CHECK_URL("http://godotengine.org", "http://", "godotengine.org", 0, "", "", Error::OK);
- CHECK_URL("https://godotengine.org:8080", "https://", "godotengine.org", 8080, "", "", Error::OK);
- CHECK_URL("https://godotengine.org/blog", "https://", "godotengine.org", 0, "/blog", "", Error::OK);
- CHECK_URL("https://godotengine.org/blog/", "https://", "godotengine.org", 0, "/blog/", "", Error::OK);
- CHECK_URL("https://docs.godotengine.org/en/stable", "https://", "docs.godotengine.org", 0, "/en/stable", "", Error::OK);
- CHECK_URL("https://docs.godotengine.org/en/stable/", "https://", "docs.godotengine.org", 0, "/en/stable/", "", Error::OK);
- CHECK_URL("https://me:secret@godotengine.org", "https://", "godotengine.org", 0, "", "", Error::OK);
+ CHECK_URL("https://redotengine.org", "https://", "redotengine.org", 0, "", "", Error::OK);
+ CHECK_URL("https://redotengine.org/", "https://", "redotengine.org", 0, "/", "", Error::OK);
+ CHECK_URL("redotengine.org/", "", "redotengine.org", 0, "/", "", Error::OK);
+ CHECK_URL("HTTPS://redotengine.org/", "https://", "redotengine.org", 0, "/", "", Error::OK);
+ CHECK_URL("https://REDOTENGINE.ORG/", "https://", "redotengine.org", 0, "/", "", Error::OK);
+ CHECK_URL("http://redotengine.org", "http://", "redotengine.org", 0, "", "", Error::OK);
+ CHECK_URL("https://redotengine.org:8080", "https://", "redotengine.org", 8080, "", "", Error::OK);
+ CHECK_URL("https://redotengine.org/blog", "https://", "redotengine.org", 0, "/blog", "", Error::OK);
+ CHECK_URL("https://redotengine.org/blog/", "https://", "redotengine.org", 0, "/blog/", "", Error::OK);
+ CHECK_URL("https://docs.redotengine.org/en/stable", "https://", "docs.redotengine.org", 0, "/en/stable", "", Error::OK);
+ CHECK_URL("https://docs.redotengine.org/en/stable/", "https://", "docs.redotengine.org", 0, "/en/stable/", "", Error::OK);
+ CHECK_URL("https://me:secret@redotengine.org", "https://", "redotengine.org", 0, "", "", Error::OK);
+ // TODO: ADD redotengine.org ipv6"
CHECK_URL("https://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/ipv6", "https://", "fedc:ba98:7654:3210:fedc:ba98:7654:3210", 0, "/ipv6", "", Error::OK);
// Scheme vs Fragment.
@@ -2027,18 +2040,18 @@ TEST_CASE("[String][URL] Parse URL") {
// Invalid URLs.
// Invalid Scheme.
- CHECK_URL("https_://godotengine.org", "", "https_", 0, "//godotengine.org", "", Error::ERR_INVALID_PARAMETER);
+ CHECK_URL("https_://redotengine.org", "", "https_", 0, "//redotengine.org", "", Error::ERR_INVALID_PARAMETER);
// Multiple ports.
- CHECK_URL("https://godotengine.org:8080:433", "https://", "", 0, "", "", Error::ERR_INVALID_PARAMETER);
+ CHECK_URL("https://redotengine.org:8080:433", "https://", "", 0, "", "", Error::ERR_INVALID_PARAMETER);
// Missing ] on literal IPv6.
CHECK_URL("https://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/ipv6", "https://", "", 0, "/ipv6", "", Error::ERR_INVALID_PARAMETER);
// Missing host.
CHECK_URL("https:///blog", "https://", "", 0, "/blog", "", Error::ERR_INVALID_PARAMETER);
// Invalid ports.
- CHECK_URL("https://godotengine.org:notaport", "https://", "godotengine.org", 0, "", "", Error::ERR_INVALID_PARAMETER);
- CHECK_URL("https://godotengine.org:-8080", "https://", "godotengine.org", -8080, "", "", Error::ERR_INVALID_PARAMETER);
- CHECK_URL("https://godotengine.org:88888", "https://", "godotengine.org", 88888, "", "", Error::ERR_INVALID_PARAMETER);
+ CHECK_URL("https://redotengine.org:notaport", "https://", "redotengine.org", 0, "", "", Error::ERR_INVALID_PARAMETER);
+ CHECK_URL("https://redotengine.org:-8080", "https://", "redotengine.org", -8080, "", "", Error::ERR_INVALID_PARAMETER);
+ CHECK_URL("https://redotengine.org:88888", "https://", "redotengine.org", 88888, "", "", Error::ERR_INVALID_PARAMETER);
#undef CHECK_URL
}
diff --git a/tests/core/templates/test_list.h b/tests/core/templates/test_list.h
index 6d95cca150..835be268e8 100644
--- a/tests/core/templates/test_list.h
+++ b/tests/core/templates/test_list.h
@@ -441,15 +441,15 @@ TEST_CASE("[List] Swap middle (values check)") {
List<String>::Element *n_str1 = list.push_back("Still");
List<String>::Element *n_str2 = list.push_back("waiting");
List<String>::Element *n_str3 = list.push_back("for");
- List<String>::Element *n_str4 = list.push_back("Godot.");
+ List<String>::Element *n_str4 = list.push_back("Redot.");
CHECK(n_str1->get() == "Still");
- CHECK(n_str4->get() == "Godot.");
+ CHECK(n_str4->get() == "Redot.");
CHECK(list.front()->get() == "Still");
CHECK(list.front()->next()->get() == "waiting");
CHECK(list.back()->prev()->get() == "for");
- CHECK(list.back()->get() == "Godot.");
+ CHECK(list.back()->get() == "Redot.");
list.swap(n_str2, n_str3);
@@ -459,18 +459,18 @@ TEST_CASE("[List] Swap middle (values check)") {
TEST_CASE("[List] Swap front and back (values check)") {
List<Variant> list;
- Variant str = "Godot";
+ Variant str = "Redot";
List<Variant>::Element *n_str = list.push_back(str);
Variant color = Color(0, 0, 1);
List<Variant>::Element *n_color = list.push_back(color);
- CHECK(list.front()->get() == "Godot");
+ CHECK(list.front()->get() == "Redot");
CHECK(list.back()->get() == Color(0, 0, 1));
list.swap(n_str, n_color);
CHECK(list.front()->get() == Color(0, 0, 1));
- CHECK(list.back()->get() == "Godot");
+ CHECK(list.back()->get() == "Redot");
}
TEST_CASE("[List] Swap adjacent back and front (reverse order of elements)") {
diff --git a/tests/core/test_time.h b/tests/core/test_time.h
index 6e31324359..5eaacecf94 100644
--- a/tests/core/test_time.h
+++ b/tests/core/test_time.h
@@ -58,10 +58,10 @@ TEST_CASE("[Time] Unix time conversion to/from datetime string") {
CHECK_MESSAGE(time->get_unix_time_from_datetime_string("1234-05-06 07:08:09") == -23215049511, "Time get_unix_time_from_datetime_string: The timestamp for an arbitrary datetime with space is as expected.");
CHECK_MESSAGE(time->get_unix_time_from_datetime_string("1234-05-06") == -23215075200, "Time get_unix_time_from_datetime_string: The timestamp for an arbitrary date without time is as expected.");
CHECK_MESSAGE(time->get_unix_time_from_datetime_string("07:08:09") == 25689, "Time get_unix_time_from_datetime_string: The timestamp for an arbitrary time without date is as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09T22:10:30") == 1391983830, "Time get_unix_time_from_datetime_string: The timestamp for GODOT IS OPEN SOURCE is as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09 22:10:30") == 1391983830, "Time get_unix_time_from_datetime_string: The timestamp for GODOT IS OPEN SOURCE with space is as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09") == 1391904000, "Time get_unix_time_from_datetime_string: The date for GODOT IS OPEN SOURCE without time is as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_string("22:10:30") == 79830, "Time get_unix_time_from_datetime_string: The time for GODOT IS OPEN SOURCE without date is as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09T22:10:30") == 1391983830, "Time get_unix_time_from_datetime_string: The timestamp for REDOT IS OPEN SOURCE is as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09 22:10:30") == 1391983830, "Time get_unix_time_from_datetime_string: The timestamp for REDOT IS OPEN SOURCE with space is as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_string("2014-02-09") == 1391904000, "Time get_unix_time_from_datetime_string: The date for REDOT IS OPEN SOURCE without time is as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_string("22:10:30") == 79830, "Time get_unix_time_from_datetime_string: The time for REDOT IS OPEN SOURCE without date is as expected.");
CHECK_MESSAGE(time->get_unix_time_from_datetime_string("-1000000000-01-01T00:00:00") == -31557014167219200, "Time get_unix_time_from_datetime_string: In the year negative a billion, Japan might not have been here.");
CHECK_MESSAGE(time->get_unix_time_from_datetime_string("1000000-01-01T00:00:00") == 31494784780800, "Time get_unix_time_from_datetime_string: The timestamp for the year a million is as expected.");
@@ -74,10 +74,10 @@ TEST_CASE("[Time] Unix time conversion to/from datetime string") {
CHECK_MESSAGE(time->get_datetime_string_from_unix_time(-23215049511, true) == "1234-05-06 07:08:09", "Time get_datetime_string_from_unix_time: The timestamp for an arbitrary datetime with space is as expected.");
CHECK_MESSAGE(time->get_date_string_from_unix_time(-23215075200) == "1234-05-06", "Time get_date_string_from_unix_time: The timestamp for an arbitrary date without time is as expected.");
CHECK_MESSAGE(time->get_time_string_from_unix_time(25689) == "07:08:09", "Time get_time_string_from_unix_time: The timestamp for an arbitrary time without date is as expected.");
- CHECK_MESSAGE(time->get_datetime_string_from_unix_time(1391983830) == "2014-02-09T22:10:30", "Time get_datetime_string_from_unix_time: The timestamp for GODOT IS OPEN SOURCE is as expected.");
- CHECK_MESSAGE(time->get_datetime_string_from_unix_time(1391983830, true) == "2014-02-09 22:10:30", "Time get_datetime_string_from_unix_time: The timestamp for GODOT IS OPEN SOURCE with space is as expected.");
- CHECK_MESSAGE(time->get_date_string_from_unix_time(1391904000) == "2014-02-09", "Time get_date_string_from_unix_time: The date for GODOT IS OPEN SOURCE without time is as expected.");
- CHECK_MESSAGE(time->get_time_string_from_unix_time(79830) == "22:10:30", "Time get_time_string_from_unix_time: The time for GODOT IS OPEN SOURCE without date is as expected.");
+ CHECK_MESSAGE(time->get_datetime_string_from_unix_time(1391983830) == "2014-02-09T22:10:30", "Time get_datetime_string_from_unix_time: The timestamp for REDOT IS OPEN SOURCE is as expected.");
+ CHECK_MESSAGE(time->get_datetime_string_from_unix_time(1391983830, true) == "2014-02-09 22:10:30", "Time get_datetime_string_from_unix_time: The timestamp for REDOT IS OPEN SOURCE with space is as expected.");
+ CHECK_MESSAGE(time->get_date_string_from_unix_time(1391904000) == "2014-02-09", "Time get_date_string_from_unix_time: The date for REDOT IS OPEN SOURCE without time is as expected.");
+ CHECK_MESSAGE(time->get_time_string_from_unix_time(79830) == "22:10:30", "Time get_time_string_from_unix_time: The time for REDOT IS OPEN SOURCE without date is as expected.");
CHECK_MESSAGE(time->get_datetime_string_from_unix_time(31494784780800) == "1000000-01-01T00:00:00", "Time get_datetime_string_from_unix_time: The timestamp for the year a million is as expected.");
CHECK_MESSAGE(time->get_offset_string_from_offset_minutes(0) == "+00:00", "Time get_offset_string_from_offset_minutes: The offset string is as expected.");
CHECK_MESSAGE(time->get_offset_string_from_offset_minutes(-600) == "-10:00", "Time get_offset_string_from_offset_minutes: The offset string is as expected.");
@@ -107,22 +107,22 @@ TEST_CASE("[Time] Datetime dictionary conversion methods") {
time_only[MINUTE_KEY] = 10;
time_only[SECOND_KEY] = 30;
- CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(datetime) == 1391983830, "Time get_unix_time_from_datetime_dict: The datetime dictionary for GODOT IS OPEN SOURCE is converted to a timestamp as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(date_only) == 1391904000, "Time get_unix_time_from_datetime_dict: The date dictionary for GODOT IS OPEN SOURCE is converted to a timestamp as expected.");
- CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(time_only) == 79830, "Time get_unix_time_from_datetime_dict: The time dictionary for GODOT IS OPEN SOURCE is converted to a timestamp as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(datetime) == 1391983830, "Time get_unix_time_from_datetime_dict: The datetime dictionary for REDOT IS OPEN SOURCE is converted to a timestamp as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(date_only) == 1391904000, "Time get_unix_time_from_datetime_dict: The date dictionary for REDOT IS OPEN SOURCE is converted to a timestamp as expected.");
+ CHECK_MESSAGE(time->get_unix_time_from_datetime_dict(time_only) == 79830, "Time get_unix_time_from_datetime_dict: The time dictionary for REDOT IS OPEN SOURCE is converted to a timestamp as expected.");
- CHECK_MESSAGE(time->get_datetime_dict_from_unix_time(1391983830).hash() == datetime.hash(), "Time get_datetime_dict_from_unix_time: The datetime timestamp for GODOT IS OPEN SOURCE is converted to a dictionary as expected.");
- CHECK_MESSAGE(time->get_date_dict_from_unix_time(1391904000).hash() == date_only.hash(), "Time get_date_dict_from_unix_time: The date timestamp for GODOT IS OPEN SOURCE is converted to a dictionary as expected.");
- CHECK_MESSAGE(time->get_time_dict_from_unix_time(79830).hash() == time_only.hash(), "Time get_time_dict_from_unix_time: The time timestamp for GODOT IS OPEN SOURCE is converted to a dictionary as expected.");
+ CHECK_MESSAGE(time->get_datetime_dict_from_unix_time(1391983830).hash() == datetime.hash(), "Time get_datetime_dict_from_unix_time: The datetime timestamp for REDOT IS OPEN SOURCE is converted to a dictionary as expected.");
+ CHECK_MESSAGE(time->get_date_dict_from_unix_time(1391904000).hash() == date_only.hash(), "Time get_date_dict_from_unix_time: The date timestamp for REDOT IS OPEN SOURCE is converted to a dictionary as expected.");
+ CHECK_MESSAGE(time->get_time_dict_from_unix_time(79830).hash() == time_only.hash(), "Time get_time_dict_from_unix_time: The time timestamp for REDOT IS OPEN SOURCE is converted to a dictionary as expected.");
CHECK_MESSAGE((Weekday)(int)time->get_datetime_dict_from_unix_time(0)[WEEKDAY_KEY] == Weekday::WEEKDAY_THURSDAY, "Time get_datetime_dict_from_unix_time: The weekday for the Unix epoch is a Thursday as expected.");
- CHECK_MESSAGE((Weekday)(int)time->get_datetime_dict_from_unix_time(1391983830)[WEEKDAY_KEY] == Weekday::WEEKDAY_SUNDAY, "Time get_datetime_dict_from_unix_time: The weekday for GODOT IS OPEN SOURCE is a Sunday as expected.");
+ CHECK_MESSAGE((Weekday)(int)time->get_datetime_dict_from_unix_time(1391983830)[WEEKDAY_KEY] == Weekday::WEEKDAY_SUNDAY, "Time get_datetime_dict_from_unix_time: The weekday for REDOT IS OPEN SOURCE is a Sunday as expected.");
- CHECK_MESSAGE(time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30").hash() == datetime.hash(), "Time get_datetime_dict_from_string: The dictionary from string for GODOT IS OPEN SOURCE works as expected.");
- CHECK_MESSAGE(!time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30", false).has(WEEKDAY_KEY), "Time get_datetime_dict_from_string: The dictionary from string for GODOT IS OPEN SOURCE without weekday doesn't contain the weekday key as expected.");
- CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(datetime) == "2014-02-09T22:10:30", "Time get_datetime_string_from_dict: The string from dictionary for GODOT IS OPEN SOURCE works as expected.");
- CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30")) == "2014-02-09T22:10:30", "Time get_datetime_string_from_dict: The round-trip string to dict to string GODOT IS OPEN SOURCE works as expected.");
- CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(time->get_datetime_dict_from_datetime_string("2014-02-09 22:10:30"), true) == "2014-02-09 22:10:30", "Time get_datetime_string_from_dict: The round-trip string to dict to string GODOT IS OPEN SOURCE with spaces works as expected.");
+ CHECK_MESSAGE(time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30").hash() == datetime.hash(), "Time get_datetime_dict_from_string: The dictionary from string for REDOT IS OPEN SOURCE works as expected.");
+ CHECK_MESSAGE(!time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30", false).has(WEEKDAY_KEY), "Time get_datetime_dict_from_string: The dictionary from string for REDOT IS OPEN SOURCE without weekday doesn't contain the weekday key as expected.");
+ CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(datetime) == "2014-02-09T22:10:30", "Time get_datetime_string_from_dict: The string from dictionary for REDOT IS OPEN SOURCE works as expected.");
+ CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(time->get_datetime_dict_from_datetime_string("2014-02-09T22:10:30")) == "2014-02-09T22:10:30", "Time get_datetime_string_from_dict: The round-trip string to dict to string REDOT IS OPEN SOURCE works as expected.");
+ CHECK_MESSAGE(time->get_datetime_string_from_datetime_dict(time->get_datetime_dict_from_datetime_string("2014-02-09 22:10:30"), true) == "2014-02-09 22:10:30", "Time get_datetime_string_from_dict: The round-trip string to dict to string REDOT IS OPEN SOURCE with spaces works as expected.");
}
TEST_CASE("[Time] System time methods") {