diff --git a/test/functional/src/images/red2.png b/test/functional/src/images/red2.png new file mode 100644 index 00000000..867a2f12 Binary files /dev/null and b/test/functional/src/images/red2.png differ diff --git a/test/functional/src/test_image51.c b/test/functional/src/test_image51.c new file mode 100644 index 00000000..59c404e4 --- /dev/null +++ b/test/functional/src/test_image51.c @@ -0,0 +1,24 @@ +/***************************************************************************** + * Test cases for libxlsxwriter. + * + * Test to compare output against Excel files. + * + * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org + * + */ + +#include "xlsxwriter.h" + +int main() { + + lxw_workbook *workbook = workbook_new("test_image51.xlsx"); + lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); + + lxw_image_options options1 = {.url = "https://duckduckgo.com/?q=1"}; + lxw_image_options options2 = {.url = "https://duckduckgo.com/?q=2"}; + + worksheet_insert_image_opt(worksheet, CELL("E9"), "images/red.png", &options1); + worksheet_insert_image_opt(worksheet, CELL("E13"), "images/red2.png", &options2); + + return workbook_close(workbook); +} diff --git a/test/functional/test_image.py b/test/functional/test_image.py index ebd0ce7e..1de807f2 100644 --- a/test/functional/test_image.py +++ b/test/functional/test_image.py @@ -139,6 +139,10 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): def test_image50(self): self.run_exe_test('test_image50') + @pytest.mark.skipif(os.environ.get('USE_NO_MD5'), reason="compiled without MD5 support") + def test_image51(self): + self.run_exe_test('test_image51') + # Test in-memory image handling. def test_image81(self): self.run_exe_test('test_image81', 'image01.xlsx') diff --git a/test/functional/xlsx_files/image51.xlsx b/test/functional/xlsx_files/image51.xlsx new file mode 100644 index 00000000..03daa485 Binary files /dev/null and b/test/functional/xlsx_files/image51.xlsx differ