1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

String: compatibility with 64 bits scalars (#7863)

time_t is now 64 bits. String(time_t) was ambiguous
tests added
This commit is contained in:
david gauchard
2021-02-13 17:47:47 +01:00
committed by GitHub
parent a886515ce9
commit 483519f852
7 changed files with 139 additions and 4 deletions

View File

@ -80,6 +80,7 @@ CORE_CPP_FILES := \
Stream.cpp \
WString.cpp \
Print.cpp \
stdlib_noniso.cpp \
FS.cpp \
spiffs_api.cpp \
MD5Builder.cpp \

View File

@ -132,6 +132,16 @@ TEST_CASE("String concantenation", "[core][String]")
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.01");
str += (double)1.01;
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01");
str += LLONG_MIN;
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808");
str += String(LLONG_MIN, 10);
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808");
str += LLONG_MAX;
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-92233720368547758089223372036854775807");
str += ULLONG_MAX;
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808922337203685477580718446744073709551615");
str += String(ULLONG_MAX, 16);
REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808922337203685477580718446744073709551615ffffffffffffffff");
str = "clean";
REQUIRE(str.concat(str) == true);
REQUIRE(str == "cleanclean");