Skip to content

Commit

Permalink
tests: Fix literal strings
Browse files Browse the repository at this point in the history
This was done a while ago, to make MSVC happier as it doesn't like
non-ascii strings in C code.

(Or at least, that was the case at the time. This was almost 5 years ago
after all…)

    commit 273d280
    Author: Linquize <linquize@yahoo.com.hk>
    Date:   Thu Oct 17 21:20:36 2013 +0800

        Do not write Chinese literal strings directly

        MSVC does not encoding Chinese literal strings as UTF-8

However, for some reason the backslashes got escaped in this file (and
only in this file), and we missed it on code review.
  • Loading branch information
Mathieu Bridon committed May 20, 2018
1 parent b7028b0 commit 1e516d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_cangjiecharlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void test_cangjie_char_list_append() {
/* Append the first node */
CangjieChar *char1;
CangjieChar *char2;
int ret = cangjie_char_new(&char1, "\\xE6\\xA3\\xAE", "\\xE6\\xA3\\xAE",
int ret = cangjie_char_new(&char1, "\xE6\xA3\xAE", "\xE6\xA3\xAE",
"ddd", 123); // 森
assert(ret == CANGJIE_OK);

Expand All @@ -38,7 +38,7 @@ void test_cangjie_char_list_append() {
assert(l->c == char1);

/* Append a new node */
ret = cangjie_char_new(&char2, "\\xE6\\x98\\x8E", "\\xE6\\x98\\x8E",
ret = cangjie_char_new(&char2, "\xE6\x98\x8E", "\xE6\x98\x8E",
"ab", 123); // 明
assert(ret == CANGJIE_OK);

Expand All @@ -57,7 +57,7 @@ void test_cangjie_char_list_prepend() {
/* Prepend the first node */
CangjieChar *char1;
CangjieChar *char2;
int ret = cangjie_char_new(&char1, "\\xE6\\x9B\\x9D", "\\xE6\\x9B\\x9D",
int ret = cangjie_char_new(&char1, "\xE6\x9B\x9D", "\xE6\x9B\x9D",
"aate", 123); // 曝
assert(ret == CANGJIE_OK);

Expand All @@ -67,7 +67,7 @@ void test_cangjie_char_list_prepend() {
assert(l->c == char1);

/* Prepend a new node */
ret = cangjie_char_new(&char2, "\\xE9\\xB7\\xB3", "\\xE9\\xB9\\x87",
ret = cangjie_char_new(&char2, "\xE9\xB7\xB3", "\xE9\xB9\x87",
"abhaf", 123); // 鷳 / 鹇
assert(ret == CANGJIE_OK);

Expand Down

0 comments on commit 1e516d8

Please sign in to comment.