summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/test_support.cpp12
-rw-r--r--testing/test_support.h7
2 files changed, 19 insertions, 0 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index a530b3ea4c..6e1bb64bc0 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -210,3 +210,15 @@ int TestSaver::WriteBlockCallback(FPDF_FILEWRITE* pFileWrite,
pThis->m_String.append(static_cast<const char*>(data), size);
return 1;
}
+
+namespace pdfium {
+
+void FPDF_Test::SetUp() {
+ FPDF_InitLibrary();
+}
+
+void FPDF_Test::TearDown() {
+ FPDF_DestroyLibrary();
+}
+
+} // namespace pdfium
diff --git a/testing/test_support.h b/testing/test_support.h
index 4111ca61ed..b734bc31f0 100644
--- a/testing/test_support.h
+++ b/testing/test_support.h
@@ -12,6 +12,7 @@
#include "public/fpdf_save.h"
#include "public/fpdfview.h"
+#include "testing/gtest/include/gtest/gtest.h"
#ifdef PDF_ENABLE_V8
#include "v8/include/v8.h"
@@ -58,6 +59,12 @@ struct FreeDeleter {
inline void operator()(void* ptr) const { free(ptr); }
};
+class FPDF_Test : public ::testing::Test {
+ public:
+ void SetUp() override;
+ void TearDown() override;
+};
+
} // namespace pdfium
// Reads the entire contents of a file into a newly alloc'd buffer.