Skip to content

Commit ee3e401

Browse files
authored
Fix unit tests in CI; fix GCC warning (#96)
* Fix running unit tests in GitHub Actions GitHub was not running them: Invalid workflow file: .github/workflows/run_unit_tests.yml#L82 You have an error in your yaml syntax on line 82 * Fix GCC warning ../tests/check_dicom.c: In function ‘test_element_CS_multivalue_empty_fn’: ../tests/check_dicom.c:306:21: warning: allocation of insufficient size ‘1’ for type ‘char *’ with size ‘8’ [-Walloc-size]
1 parent 4e97644 commit ee3e401

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/run_unit_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979
$sudo meson install -C builddir
8080
8181
- name: Rebuild the shared library cache
82-
if: startsWith(matrix.os, 'ubuntu')
83-
run: sudo ldconfig
82+
if: startsWith(matrix.os, 'ubuntu')
83+
run: sudo ldconfig
8484

8585
- name: Run unit tests
8686
# Don't run tests for private copy of Check

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* much faster read of files with an EOT but no FGS [pcram-techcyte]
1010
* add `dcm_filehandle_get_frame_number()` [jcupitt]
1111
* add DICOM catenation support [jcupitt]
12+
* fix GCC compiler warning [bgilbert]
1213

1314
## 1.1.0, 28/3/24
1415

tests/check_dicom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ START_TEST(test_element_CS_multivalue_empty)
303303
uint32_t vm = 0;
304304

305305
// since malloc(0) can be NULL on some platforms
306-
char **values = malloc(1);
306+
char **values = malloc(sizeof(char *));
307307

308308
DcmElement *element = dcm_element_create(NULL, tag, DCM_VR_CS);
309309
(void) dcm_element_set_value_string_multi(NULL, element, values, vm, true);

0 commit comments

Comments
 (0)