Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: fpdfsdk/fpdfview_unittest.cpp

Issue 2543833002: Protect against unexpected library create/destroy (Closed)
Patch Set: Add unittest Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview_unittest.cpp
diff --git a/fpdfsdk/fpdfview_unittest.cpp b/fpdfsdk/fpdfview_unittest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..27680b3d4e135f91907cadcbcb64c5613f4f3aaf
--- /dev/null
+++ b/fpdfsdk/fpdfview_unittest.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "public/fpdfview.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/test_support.h"
+
+TEST(FPDFView, DoubleInit) {
+ FPDF_InitLibrary();
+ FPDF_InitLibrary();
+ FPDF_DestroyLibrary();
+}
+
+TEST(FPDFView, DoubleDestroy) {
+ FPDF_InitLibrary();
+ FPDF_DestroyLibrary();
+ FPDF_DestroyLibrary();
+}
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698