diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-01 15:44:08 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-01 15:44:08 +0000 |
commit | 8072e4fdc8261b1ca8937aa5c31db967280eae2a (patch) | |
tree | 321534079fe0b1c20bb8fd009ab8c7cff0304e8e /tests | |
parent | b652427197ddaac5d35010e1b199bcb431e656b7 (diff) |
bump SkStrAppendScalar_MaxSize to 14 to accomodate the largest string now that
scalar->string uses %.8g. Floats have at most 8 significant digits, plus we add
more space for sign, decimal point and exponent.
add tests to check these limits.
git-svn-id: http://skia.googlecode.com/svn/trunk@872 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/StringTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/StringTest.cpp b/tests/StringTest.cpp index 781fed8bf7..270ccfd3a4 100644 --- a/tests/StringTest.cpp +++ b/tests/StringTest.cpp @@ -73,10 +73,16 @@ static void TestString(skiatest::Reporter* reporter) { { SK_Scalar1, "1" }, { -SK_Scalar1, "-1" }, { SK_Scalar1/2, "0.5" }, +#ifdef SK_SCALAR_IS_FLOAT + { 3.4028234e38f, "3.4028235e+38" }, + { -3.4028234e38f, "-3.4028235e+38" }, +#endif }; for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) { a.reset(); a.appendScalar(gRec[i].fValue); + REPORTER_ASSERT(reporter, a.size() <= SkStrAppendScalar_MaxSize); +// SkDebugf(" received <%s> expected <%s>\n", a.c_str(), gRec[i].fString); REPORTER_ASSERT(reporter, a.equals(gRec[i].fString)); } } |