[ox/std] Fix string number/char* append
This commit is contained in:
parent
38400e4406
commit
c9d816503d
2
deps/ox/src/ox/std/string.hpp
vendored
2
deps/ox/src/ox/std/string.hpp
vendored
@ -114,7 +114,7 @@ constexpr const BString<size> &BString<size>::operator+=(const char *str) noexce
|
||||
|
||||
template<std::size_t size>
|
||||
constexpr const BString<size> &BString<size>::operator+=(char *str) noexcept {
|
||||
return *this = static_cast<const char*>(str);
|
||||
return *this += static_cast<const char*>(str);
|
||||
}
|
||||
|
||||
template<std::size_t size>
|
||||
|
1
deps/ox/src/ox/std/test/CMakeLists.txt
vendored
1
deps/ox/src/ox/std/test/CMakeLists.txt
vendored
@ -11,5 +11,6 @@ add_test("Test\\ ox_memcmp\\ ABCDEFG\\ !=\\ HIJKLMN" StdTest "ABCDEFG != HIJKLMN
|
||||
add_test("Test\\ ox_memcmp\\ HIJKLMN\\ !=\\ ABCDEFG" StdTest "HIJKLMN != ABCDEFG")
|
||||
add_test("Test\\ ox_memcmp\\ ABCDEFG\\ ==\\ ABCDEFG" StdTest "ABCDEFG == ABCDEFG")
|
||||
add_test("Test\\ ox_memcmp\\ ABCDEFGHI\\ ==\\ ABCDEFG" StdTest "ABCDEFGHI == ABCDEFG")
|
||||
add_test("Test\\ BString" StdTest "BString")
|
||||
add_test("Test\\ Vector" StdTest "Vector")
|
||||
add_test("Test\\ HashMap" StdTest "HashMap")
|
||||
|
12
deps/ox/src/ox/std/test/tests.cpp
vendored
12
deps/ox/src/ox/std/test/tests.cpp
vendored
@ -37,6 +37,18 @@ map<string, function<int()>> tests = {
|
||||
return !(ox_memcmp("ABCDEFGHI", "ABCDEFG", 7) == 0);
|
||||
}
|
||||
},
|
||||
{
|
||||
"BString",
|
||||
[]() {
|
||||
ox::BString<100> s;
|
||||
s += "A";
|
||||
s += "B";
|
||||
s += 9;
|
||||
s += "C";
|
||||
oxAssert(s == "AB9C", "BString append broken");
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
{
|
||||
"Vector",
|
||||
[] {
|
||||
|
Loading…
Reference in New Issue
Block a user