Merge branch 'master' into 1.8.x

This commit is contained in:
Alexey Sokolov
2020-04-20 21:10:39 +01:00
3 changed files with 14 additions and 7 deletions
+6 -1
View File
@@ -126,7 +126,12 @@ install:
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$BUILD_WITH" == "cmake" ]]; then brew outdated cmake || brew upgrade cmake; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew info --json=v1 --installed | jq .; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PKG_CONFIG_PATH="$(brew --prefix qt5)/lib/pkgconfig:$PKG_CONFIG_PATH"; fi
- pip3 install coverage
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ls -la ~/.cache; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ls -la ~/.cache/pip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ls -la ~/.cache/pip/wheels; fi
# bad permissions on ARM machine on travis
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ~/.cache/pip ~/.cache/pip_bad; fi
- pip3 install --user coverage
- export ZNC_MODPYTHON_COVERAGE=1
- "echo pkg-config path: [$PKG_CONFIG_PATH]"
script:
+4 -4
View File
@@ -294,13 +294,13 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const {
}
if (ch == 0) {
if (!strncasecmp((const char*)&pTmp, "<", 2))
if (!strncasecmp((const char*)&pTmp, "<", 4))
ch = '<';
else if (!strncasecmp((const char*)&pTmp, "&gt;", 2))
else if (!strncasecmp((const char*)&pTmp, "&gt;", 4))
ch = '>';
else if (!strncasecmp((const char*)&pTmp, "&quot;", 4))
else if (!strncasecmp((const char*)&pTmp, "&quot;", 6))
ch = '"';
else if (!strncasecmp((const char*)&pTmp, "&amp;", 3))
else if (!strncasecmp((const char*)&pTmp, "&amp;", 5))
ch = '&';
}
+4 -2
View File
@@ -53,6 +53,8 @@ TEST_F(EscapeTest, Test) {
testString("&<>", "%26%3C%3E", "&amp;&lt;&gt;", "&<>", "&<>");
testString(" ;", "+%3B", " ;", " ;", "\\s\\:");
// clang-format on
EXPECT_EQ(CString("a&lt.b&gt;c").Escape_n(CString::EHTML, CString::EASCII),
"a&lt.b>c");
}
TEST(StringTest, Bool) {
@@ -199,8 +201,8 @@ TEST(StringTest, Equals) {
TEST(StringTest, Find) {
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello"), 0u);
EXPECT_EQ(
CString("Hello, I'm Bob").Find("Hello", CString::CaseInsensitive), 0u);
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseInsensitive),
0u);
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseSensitive),
0u);