summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOliver Sander <oliver.sander@tu-dresden.de>2019-11-02 17:50:59 +0100
committerOliver Sander <oliver.sander@tu-dresden.de>2019-11-09 05:33:04 +0000
commit759d190581f8ff069ecee9155313a8e69a2ca9c6 (patch)
treebee4eb7f4d43786703256708e6cb92d1a575218f /test
parent8b4a2891d9e4ca8ac835527cc7d114ab08e89ea7 (diff)
Make globalParams a std::unique_ptr
Diffstat (limited to 'test')
-rw-r--r--test/gtk-test.cc4
-rw-r--r--test/pdf-fullrewrite.cc3
-rw-r--r--test/pdf-inspector.cc3
-rw-r--r--test/perf-test.cc3
4 files changed, 4 insertions, 9 deletions
diff --git a/test/gtk-test.cc b/test/gtk-test.cc
index 24fd39ce..f103185d 100644
--- a/test/gtk-test.cc
+++ b/test/gtk-test.cc
@@ -369,7 +369,7 @@ main (int argc, char *argv [])
gtk_init (&argc, &argv);
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
for (int i = 0; file_arguments[i]; i++) {
View *view;
@@ -399,7 +399,5 @@ main (int argc, char *argv [])
gtk_main ();
- delete globalParams;
-
return 0;
}
diff --git a/test/pdf-fullrewrite.cc b/test/pdf-fullrewrite.cc
index a9e3e8ef..2cb4b028 100644
--- a/test/pdf-fullrewrite.cc
+++ b/test/pdf-fullrewrite.cc
@@ -75,7 +75,7 @@ int main (int argc, char *argv[])
}
// load input document
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
doc = new PDFDoc(inputName, ownerPW, userPW);
if (!doc->isOk()) {
fprintf(stderr, "Error loading input document\n");
@@ -107,7 +107,6 @@ int main (int argc, char *argv[])
done:
delete docOut;
delete doc;
- delete globalParams;
delete userPW;
delete ownerPW;
return res;
diff --git a/test/pdf-inspector.cc b/test/pdf-inspector.cc
index d2df5e30..17f5fc69 100644
--- a/test/pdf-inspector.cc
+++ b/test/pdf-inspector.cc
@@ -334,7 +334,7 @@ main (int argc, char *argv [])
gtk_init (&argc, &argv);
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
globalParams->setProfileCommands (true);
globalParams->setPrintCommands (true);
@@ -354,7 +354,6 @@ main (int argc, char *argv [])
inspector->run ();
delete inspector;
- delete globalParams;
return 0;
}
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 83c8c5f8..2b0d9c4e 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -1237,7 +1237,7 @@ int main(int argc, char **argv)
assert(gArgsListRoot);
SplashColorsInit();
- globalParams = new GlobalParams();
+ globalParams = std::make_unique<GlobalParams>();
if (!globalParams)
return 1;
globalParams->setErrQuiet(false);
@@ -1270,7 +1270,6 @@ int main(int argc, char **argv)
fclose(outFile);
PreviewBitmapDestroy();
StrList_Destroy(&gArgsListRoot);
- delete globalParams;
free(gOutFileName);
return 0;
}