Skip to content

Commit

Permalink
Fix test for UTF-16 encoding
Browse files Browse the repository at this point in the history
Being variable we cannot compute translated length in advance.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
  • Loading branch information
freddy77 committed Mar 19, 2015
1 parent 0f526af commit b93f592
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/odbc/unittests/getdata.c
Expand Up @@ -74,28 +74,33 @@ test_split(const char *n_flag)
/* these 2 tests test an old severe BUG in FreeTDS */
buf = ODBC_GET(1);
CHKGetData(1, type, buf, 0, &len, "I");
CheckLen(505*lc);
if (len != SQL_NO_TOTAL)
CheckLen(505*lc);
CHKGetData(1, type, buf, 0, &len, "I");
CheckLen(505*lc);
if (len != SQL_NO_TOTAL)
CheckLen(505*lc);
buf = ODBC_GET(3*lc);
CHKGetData(1, type, buf, 3 * lc, &len, "I");
CheckLen(505*lc);
if (len != SQL_NO_TOTAL)
CheckLen(505*lc);
if (mycmp(buf, "Pr") != 0) {
printf("Wrong data result 1\n");
exit(1);
}

buf = ODBC_GET(16*lc);
CHKGetData(1, type, buf, 16 * lc, &len, "I");
CheckLen(503*lc);
if (len != SQL_NO_TOTAL)
CheckLen(503*lc);
if (mycmp(buf, "ovaxxxxxxxxxxxx") != 0) {
printf("Wrong data result 2 res = '%s'\n", buf);
exit(1);
}

buf = ODBC_GET(256*lc);
CHKGetData(1, type, buf, 256 * lc, &len, "I");
CheckLen(488*lc);
if (len != SQL_NO_TOTAL)
CheckLen(488*lc);
CHKGetData(1, type, buf, 256 * lc, &len, "S");
CheckLen(233*lc);
CHKGetData(1, type, buf, 256 * lc, &len, "No");
Expand Down

0 comments on commit b93f592

Please sign in to comment.