testtokenize:simplifyFloatCasts(): Added testcases for double and long double.
This commit is contained in:
parent
27a40b10e1
commit
1798fc3645
|
@ -1126,9 +1126,18 @@ private:
|
|||
}
|
||||
|
||||
void simplifyFloatCasts() { // float casting integers
|
||||
// C-style casts
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = (float)1;"));
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = ((float)1);"));
|
||||
ASSERT_EQUALS("a = 291.0 ;", tokenizeAndStringify("a = ((float)0x123);"));
|
||||
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = (double)1;"));
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = ((double)1);"));
|
||||
ASSERT_EQUALS("a = 291.0 ;", tokenizeAndStringify("a = ((double)0x123);"));
|
||||
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = (long double)1;"));
|
||||
ASSERT_EQUALS("a = 1.0 ;", tokenizeAndStringify("a = ((long double)1);"));
|
||||
ASSERT_EQUALS("a = 291.0 ;", tokenizeAndStringify("a = ((long double)0x123);"));
|
||||
}
|
||||
|
||||
void inlineasm() {
|
||||
|
|
Loading…
Reference in New Issue