summaryrefslogtreecommitdiff
path: root/samples/pdfium_test.cc
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-22 12:20:58 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-22 19:38:17 +0000
commit143959dba65c78f404a5d8984edb5ec5e507325e (patch)
treed530dd8485ea3f457952eefe5bc8b6958b1cf8c9 /samples/pdfium_test.cc
parentb32a949d667600cb33e80e1bb8c97a23d96f27d9 (diff)
downloadpdfium-143959dba65c78f404a5d8984edb5ec5e507325e.tar.xz
Move image_diff code into testing/image_diff/
It is not actually a sample program to demonstrate how to use PDFium APIs. It is more of a test utility program. Remove header include dependency from samples/ to core/, to set a good example. Change-Id: Idd5d567c82314bcf0e4a7bec8a3210e7d57226ee Reviewed-on: https://pdfium-review.googlesource.com/6871 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r--samples/pdfium_test.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index a53edb77d3..ccd57a7e6a 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -18,7 +18,6 @@
#define _SKIA_SUPPORT_
#endif
-#include "core/fdrm/crypto/fx_crypt.h"
#include "public/cpp/fpdf_deleters.h"
#include "public/fpdf_annot.h"
#include "public/fpdf_dataavail.h"
@@ -28,7 +27,7 @@
#include "public/fpdf_structtree.h"
#include "public/fpdf_text.h"
#include "public/fpdfview.h"
-#include "samples/image_diff_png.h"
+#include "testing/image_diff/image_diff_png.h"
#include "testing/test_support.h"
#include "third_party/base/logging.h"
@@ -121,12 +120,9 @@ static bool CheckDimensions(int stride, int width, int height) {
static void OutputMD5Hash(const char* file_name, const char* buffer, int len) {
// Get the MD5 hash and write it to stdout.
- uint8_t digest[16];
- CRYPT_MD5Generate(reinterpret_cast<const uint8_t*>(buffer), len, digest);
- printf("MD5:%s:", file_name);
- for (int i = 0; i < 16; i++)
- printf("%02x", digest[i]);
- printf("\n");
+ std::string hash =
+ GenerateMD5Base16(reinterpret_cast<const uint8_t*>(buffer), len);
+ printf("MD5:%s:%s\n", file_name, hash.c_str());
}
static std::string WritePpm(const char* pdf_name,