mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Improve strlogicalcmp for strings of unequal lengths
This version actually works and doesn't overrun provided buffers
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/util/Util.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
@@ -147,3 +148,10 @@ TEST_F(StringTest, ToUpper_Japanese)
|
||||
auto actual = String::ToUpper(u8"日本語で大文字がなし");
|
||||
ASSERT_STREQ(actual.c_str(), u8"日本語で大文字がなし");
|
||||
}
|
||||
|
||||
TEST_F(StringTest, strlogicalcmp)
|
||||
{
|
||||
auto res1 = strlogicalcmp("foo1", "foo1_2");
|
||||
auto res2 = strlogicalcmp("foo1_2", "foo1");
|
||||
ASSERT_NE(res1, res2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user