SkPDF: unit test cleanup

BUG=skia:3585

Review URL: https://codereview.chromium.org/1033833002
This commit is contained in:
halcanary 2015-03-24 15:29:39 -07:00 committed by Commit bot
parent 0dc4dd6dda
commit f3d53a037d

View File

@ -23,24 +23,6 @@
#include "SkTypes.h"
#include "Test.h"
class SkPDFTestDict : public SkPDFDict {
public:
virtual void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
SkTSet<SkPDFObject*>* newResourceObjects) {
for (int i = 0; i < fResources.count(); i++) {
newResourceObjects->add(fResources[i]);
fResources[i]->ref();
}
}
void addResource(SkPDFObject* object) {
fResources.append(1, &object);
}
private:
SkTDArray<SkPDFObject*> fResources;
};
#define DUMMY_TEXT "DCT compessed stream."
static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset,
@ -197,8 +179,8 @@ static void TestObjectRef(skiatest::Reporter* reporter) {
}
static void TestSubstitute(skiatest::Reporter* reporter) {
SkAutoTUnref<SkPDFTestDict> proxy(new SkPDFTestDict());
SkAutoTUnref<SkPDFTestDict> stub(new SkPDFTestDict());
SkAutoTUnref<SkPDFDict> proxy(new SkPDFDict());
SkAutoTUnref<SkPDFDict> stub(new SkPDFDict());
proxy->insert("Value", new SkPDFInt(33))->unref();
stub->insert("Value", new SkPDFInt(44))->unref();