tests: Fix MSVC6 compatibility

Apply the usual workaround for for scoping issues. Also fix integer conversion
warning for BorlandC.
This commit is contained in:
Arseny Kapoulkine 2015-05-03 17:55:46 -07:00
parent 873c8e5011
commit cff35dfa31
2 changed files with 12 additions and 12 deletions

View File

@ -614,7 +614,7 @@ TEST(xpath_api_query_vector)
for (int i = 0; i < 10; ++i)
{
char_t expr[2];
expr[0] = '0' + char_t(i);
expr[0] = char_t('0' + i);
expr[1] = 0;
qv.push_back(xpath_query(expr));

View File

@ -527,8 +527,8 @@ TEST(xpath_variables_copy_big)
{
char_t name[4];
name[0] = 'a';
name[1] = '0' + char_t(i / 10);
name[2] = '0' + char_t(i % 10);
name[1] = char_t('0' + i / 10);
name[2] = char_t('0' + i % 10);
name[3] = 0;
set.set(name, double(i));
@ -536,15 +536,15 @@ TEST(xpath_variables_copy_big)
xpath_variable_set copy = set;
for (int i = 0; i < 100; ++i)
for (int j = 0; j < 100; ++j)
{
char_t name[4];
name[0] = 'a';
name[1] = '0' + char_t(i / 10);
name[2] = '0' + char_t(i % 10);
name[1] = char_t('0' + j / 10);
name[2] = char_t('0' + j % 10);
name[3] = 0;
CHECK(copy.get(name) && copy.get(name)->get_number() == i);
CHECK(copy.get(name) && copy.get(name)->get_number() == j);
}
}
@ -556,8 +556,8 @@ TEST(xpath_variables_copy_big_out_of_memory)
{
char_t name[4];
name[0] = 'a';
name[1] = '0' + char_t(i / 10);
name[2] = '0' + char_t(i % 10);
name[1] = char_t('0' + i / 10);
name[2] = char_t('0' + i % 10);
name[3] = 0;
set.set(name, double(i));
@ -568,12 +568,12 @@ TEST(xpath_variables_copy_big_out_of_memory)
xpath_variable_set copy;
CHECK_ALLOC_FAIL(copy = set);
for (int i = 0; i < 100; ++i)
for (int j = 0; j < 100; ++j)
{
char_t name[4];
name[0] = 'a';
name[1] = '0' + char_t(i / 10);
name[2] = '0' + char_t(i % 10);
name[1] = char_t('0' + j / 10);
name[2] = char_t('0' + j % 10);
name[3] = 0;
CHECK(!copy.get(name));