mirror of
https://github.com/jmcnamara/libxlsxwriter
synced 2025-03-28 21:13:14 +00:00
Added more tests for image descriptions.
This commit is contained in:
parent
29c5461610
commit
ae4e652e57
22
test/functional/src/test_image52.c
Normal file
22
test/functional/src/test_image52.c
Normal file
@ -0,0 +1,22 @@
|
||||
/*****************************************************************************
|
||||
* 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_image52.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
lxw_image_options options = {.description = "This is some alternative text"};
|
||||
|
||||
worksheet_insert_image_opt(worksheet, CELL("E9"), "images/red.png", &options);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
22
test/functional/src/test_image53.c
Normal file
22
test/functional/src/test_image53.c
Normal file
@ -0,0 +1,22 @@
|
||||
/*****************************************************************************
|
||||
* 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_image53.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
lxw_image_options options = {.description = ""};
|
||||
|
||||
worksheet_insert_image_opt(worksheet, CELL("E9"), "images/red.png", &options);
|
||||
|
||||
return workbook_close(workbook);
|
||||
}
|
@ -127,6 +127,7 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
|
||||
def test_image47(self):
|
||||
self.run_exe_test('test_image47')
|
||||
|
||||
# Some of the following tests require MD5 hash support to remove duplicate images.
|
||||
@pytest.mark.skipif(os.environ.get('USE_NO_MD5'), reason="compiled without MD5 support")
|
||||
def test_image48(self):
|
||||
self.run_exe_test('test_image48')
|
||||
@ -143,6 +144,12 @@ class TestCompareXLSXFiles(base_test_class.XLSXBaseTest):
|
||||
def test_image51(self):
|
||||
self.run_exe_test('test_image51')
|
||||
|
||||
def test_image52(self):
|
||||
self.run_exe_test('test_image52')
|
||||
|
||||
def test_image53(self):
|
||||
self.run_exe_test('test_image53')
|
||||
|
||||
# Test in-memory image handling.
|
||||
def test_image81(self):
|
||||
self.run_exe_test('test_image81', 'image01.xlsx')
|
||||
|
BIN
test/functional/xlsx_files/image52.xlsx
Normal file
BIN
test/functional/xlsx_files/image52.xlsx
Normal file
Binary file not shown.
BIN
test/functional/xlsx_files/image53.xlsx
Normal file
BIN
test/functional/xlsx_files/image53.xlsx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user