Commit c0a1eb3c by alokp@chromium.org

Fixed compile error on android. It was complaining about tolower. This patch…

Fixed compile error on android. It was complaining about tolower. This patch removes the usage of tolower, and adds tests for checking both versions of hexadecimal integers - 0x and 0X. git-svn-id: https://angleproject.googlecode.com/svn/trunk@1195 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f099dfdb
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1194
#define BUILD_REVISION 1195
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -13,7 +13,9 @@ template<typename IntType>
static bool atoi_t(const std::string& str, IntType* value)
{
std::ios::fmtflags base = std::ios::dec;
if ((str.size() >= 2) && (str[0] == '0') && (tolower(str[1]) == 'x'))
if ((str.size() >= 2) &&
(str[0] == '0') &&
((str[1] == 'x') || (str[1] == 'X')))
{
base = std::ios::hex;
}
......
......@@ -65,17 +65,17 @@ INSTANTIATE_TEST_CASE_P(OctalInteger,
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_0_9,
IntegerTest,
testing::Combine(testing::Values("0x"),
testing::Combine(testing::Values("0x", "0X"),
CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_a_f,
IntegerTest,
testing::Combine(testing::Values("0x"),
testing::Combine(testing::Values("0x", "0X"),
CLOSED_RANGE('a', 'f')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_A_F,
IntegerTest,
testing::Combine(testing::Values("0x"),
testing::Combine(testing::Values("0x", "0X"),
CLOSED_RANGE('A', 'F')));
class FloatTest : public PreprocessorTest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment