include/msvcrt: Define _TRUNCATE; use it in the tests.

This commit is contained in:
Alexander Scott-Johns 2010-06-06 16:24:09 +01:00 committed by Alexandre Julliard
parent 2663079c60
commit 4e8e2f39c5
2 changed files with 6 additions and 4 deletions

View File

@ -1215,22 +1215,22 @@ static void test_mbstowcs(void)
return;
}
err = pmbstowcs_s(&ret, wOut, 6, mSimple, -1/*_TRUNCATE*/);
err = pmbstowcs_s(&ret, wOut, 6, mSimple, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(wOut, wSimple, sizeof(wSimple)), "wOut = %s\n", wine_dbgstr_w(wOut));
err = pmbstowcs_s(&ret, wOut, 6, mHiragana, -1/*_TRUNCATE*/);
err = pmbstowcs_s(&ret, wOut, 6, mHiragana, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 3, "ret = %d\n", (int)ret);
ok(!memcmp(wOut, wHiragana, sizeof(wHiragana)), "wOut = %s\n", wine_dbgstr_w(wOut));
err = pwcstombs_s(&ret, mOut, 6, wSimple, -1/*_TRUNCATE*/);
err = pwcstombs_s(&ret, mOut, 6, wSimple, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(mOut, mSimple, sizeof(mSimple)), "mOut = %s\n", mOut);
err = pwcstombs_s(&ret, mOut, 6, wHiragana, -1/*_TRUNCATE*/);
err = pwcstombs_s(&ret, mOut, 6, wHiragana, _TRUNCATE);
ok(err == 0, "err = %d\n", err);
ok(ret == 5, "ret = %d\n", (int)ret);
ok(!memcmp(mOut, mHiragana, sizeof(mHiragana)), "mOut = %s\n", mOut);

View File

@ -47,6 +47,8 @@ typedef struct
#define _MAX_PATH 260
#endif
/* Make the secure string functions (names end in "_s") truncate their output */
#define _TRUNCATE ((size_t)-1)
typedef struct _div_t {
int quot;