From ac42dd2d4b5bfefcbdd023b196db45bff94a1a7c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 5 Jun 2018 13:28:58 +0000 Subject: Improve FPDFPath_GetMatrix() tests The test succeeded if FPDFPath_GetMatrix() did not touch its out parameters, now this is covered. Change-Id: I04e3c4bd55e0a8e403e88dbc23ec21e8d00eacf2 Reviewed-on: https://pdfium-review.googlesource.com/33870 Reviewed-by: dsinclair Commit-Queue: dsinclair --- fpdfsdk/fpdf_edit_embeddertest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 7ca2174440..b2a7c32153 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp @@ -258,6 +258,14 @@ TEST_F(FPDFEditEmbeddertest, AddPaths) { matrix_d, matrix_e, matrix_f)); EXPECT_TRUE(FPDFPath_SetMatrix(red_rect, matrix_a, matrix_b, matrix_c, matrix_d, matrix_e, matrix_f)); + // Set to 0 before FPDFPath_GetMatrix() to ensure they are actually set by + // the function. + matrix_a = 0; + matrix_b = 0; + matrix_c = 0; + matrix_d = 0; + matrix_e = 0; + matrix_f = 0; EXPECT_FALSE(FPDFPath_GetMatrix(nullptr, &matrix_a, &matrix_b, &matrix_c, &matrix_d, &matrix_e, &matrix_f)); EXPECT_TRUE(FPDFPath_GetMatrix(red_rect, &matrix_a, &matrix_b, &matrix_c, -- cgit v1.2.3