diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 98398c344..20333f8e9 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -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() {