summaryrefslogtreecommitdiffstats
path: root/tests/FontTestUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FontTestUtils.cpp')
-rw-r--r--tests/FontTestUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/FontTestUtils.cpp b/tests/FontTestUtils.cpp
index 98dab51..fdc3ed6 100644
--- a/tests/FontTestUtils.cpp
+++ b/tests/FontTestUtils.cpp
@@ -24,8 +24,7 @@
#include "FontLanguage.h"
#include "MinikinFontForTest.h"
-std::unique_ptr<android::FontCollection> getFontCollection(
- const char* fontDir, const char* fontXml) {
+android::FontCollection* getFontCollection(const char* fontDir, const char* fontXml) {
xmlDoc* doc = xmlReadFile(fontXml, NULL, 0);
xmlNode* familySet = xmlDocGetRootElement(doc);
@@ -73,9 +72,10 @@ std::unique_ptr<android::FontCollection> getFontCollection(
}
xmlFreeDoc(doc);
- std::unique_ptr<android::FontCollection> r(new android::FontCollection(families));
+ android::FontCollection* collection = new android::FontCollection(families);
+ collection->Ref();
for (size_t i = 0; i < families.size(); ++i) {
families[i]->Unref();
}
- return r;
+ return collection;
}