diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:01:46 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:01:46 +0000 |
commit | edae1416ba6ca8a47e208ed056680677d568dd73 (patch) | |
tree | 1445271a891423614ed20cffbbe034b8ea65316e /tests | |
parent | b213ed8b767b424cb076bfbab11e936d16526635 (diff) |
Fix metrics test to no longer include the cpp.
The inclusion of the cpp caused linker errors when building skia
components as shared libaries for inclusion in an Android app.
Review URL: https://codereview.appspot.com/6338063
git-svn-id: http://skia.googlecode.com/svn/trunk@4323 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/WArrayTest.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tests/WArrayTest.cpp b/tests/WArrayTest.cpp index daab543a03..4a5b879ca5 100644 --- a/tests/WArrayTest.cpp +++ b/tests/WArrayTest.cpp @@ -8,7 +8,7 @@ #include "Test.h" // Include the implementation so we can make an appropriate template instance. -#include "SkAdvancedTypefaceMetrics.cpp" +#include "SkAdvancedTypefaceMetrics.h" using namespace skia_advanced_typeface_metrics_utils; @@ -102,8 +102,7 @@ const char* expectedSubset14 = "0[1] 5[2]"; } -static SkString stringify_advance_data( - SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t>* data) { +static SkString stringify_advance_data(SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t>* data) { SkString result; bool leadingSpace = false; while (data != NULL) { @@ -114,8 +113,7 @@ static SkString stringify_advance_data( } switch(data->fType) { case SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t>::kRun: - result.appendf("%d %d %d", data->fStartId, data->fEndId, - data->fAdvance[0]); + result.appendf("%d %d %d", data->fStartId, data->fEndId, data->fAdvance[0]); break; case SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t>::kRange: result.appendf("%d[", data->fStartId); @@ -139,10 +137,8 @@ static SkString stringify_advance_data( class TestWData { public: TestWData(skiatest::Reporter* reporter, - const int16_t advances[], - int advanceLen, - const uint32_t subset[], - int subsetLen, + const int16_t advances[], int advanceLen, + const uint32_t subset[], int subsetLen, const char* expected) : fAdvances(advances) , fAdvancesLen(advanceLen) @@ -159,7 +155,8 @@ class TestWData { const int fSubsetLen; const char* fExpected; - static bool getAdvance(TestWData* testCase, int gId, int16_t* advance) { + static bool getAdvance(void* tc, int gId, int16_t* advance) { + TestWData* testCase = (TestWData*)tc; if (gId >= 0 && gId < testCase->fAdvancesLen) { *advance = testCase->fAdvances[gId]; return true; @@ -169,13 +166,11 @@ class TestWData { bool RunTest() { SkTScopedPtr<SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t> > result; - result.reset(getAdvanceData(this, fAdvancesLen, fSubset, fSubsetLen, - getAdvance)); + result.reset(getAdvanceData((void*)this, fAdvancesLen, fSubset, fSubsetLen, getAdvance)); SkString stringResult = stringify_advance_data(result.get()); if (!stringResult.equals(fExpected)) { - printf("Expected: %s\n Result: %s\n", fExpected, - stringResult.c_str()); + printf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_str()); return false; } return true; |