Move fx_safe_types.h to include/ directory.
[pdfium.git] / core / src / fpdfapi / fpdf_parser / fpdf_parser_decode_embeddertest.cpp
index 2769f3c..6f97c08 100644 (file)
@@ -5,7 +5,7 @@
 #include <cstring>
 #include <string>
 
-#include "../../../../fpdfsdk/include/fpdfview.h"
+#include "../../../../public/fpdfview.h"
 #include "../../../../testing/fx_string_testhelpers.h"
 #include "../../../include/fpdfapi/fpdf_parser.h"
 #include "../../../include/fxcrt/fx_basic.h"
@@ -50,10 +50,12 @@ TEST_F(FPDFParserDecodeEmbeddertest, FlateEncode) {
     FlateEncodeCase* ptr = &flate_encode_cases[i];
     unsigned char* result;
     unsigned int result_size;
-    FlateEncode(ptr->input, ptr->input_size, result, result_size); // Leaks.
+    FlateEncode(ptr->input, ptr->input_size, result, result_size);
+    ASSERT_TRUE(result);
     EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size),
               std::string((const char*)result, result_size))
         << " for case " << i;
+    FX_Free(result);
   }
 }
 
@@ -87,10 +89,12 @@ TEST_F(FPDFParserDecodeEmbeddertest, FlateDecode) {
     FlateDecodeCase* ptr = &flate_decode_cases[i];
     unsigned char* result;
     unsigned int result_size;
-    FlateDecode(ptr->input, ptr->input_size, result, result_size); // Leaks.
+    FlateDecode(ptr->input, ptr->input_size, result, result_size);
+    ASSERT_TRUE(result);
     EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size),
               std::string((const char*)result, result_size))
         << " for case " << i;
+    FX_Free(result);
   }
 }