diff --git a/dcmdata/tests/tfrmsiz.cc b/dcmdata/tests/tfrmsiz.cc index e14fa56db..10b0329f9 100644 --- a/dcmdata/tests/tfrmsiz.cc +++ b/dcmdata/tests/tfrmsiz.cc @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2024, OFFIS e.V. + * Copyright (C) 2024-2025, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation are maintained by @@ -130,6 +130,9 @@ OFTEST(dcmdata_uncompressedFrameSize) OFCHECK(0 == px->decodedBitsAllocated(13, 8)); OFCHECK(16 == px->decodedBitsAllocated(16, 8)); OFCHECK(64 == px->decodedBitsAllocated(64, 8)); + + // avoid memory leak + DcmRLEDecoderRegistration::cleanup(); } } } diff --git a/dcmect/tests/t_overflow.cc b/dcmect/tests/t_overflow.cc index 4e07a5c54..fb6ef9c75 100644 --- a/dcmect/tests/t_overflow.cc +++ b/dcmect/tests/t_overflow.cc @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2024, OFFIS e.V. + * Copyright (C) 2024-2025, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation were developed by @@ -87,6 +87,7 @@ OFTEST(dcmect_overflow) OFCondition result; result = ct->saveFile("output.dcm", EXS_LittleEndianExplicit); OFCHECK_MSG(result == ECT_InvalidPixelInfo, result.text()); + delete ct; } static EctEnhancedCT *create() diff --git a/dcmfg/tests/t_fg_base.cc b/dcmfg/tests/t_fg_base.cc index 00437a68b..faec81038 100644 --- a/dcmfg/tests/t_fg_base.cc +++ b/dcmfg/tests/t_fg_base.cc @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2022-2024, OFFIS e.V. + * Copyright (C) 2022-2025, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation were developed by @@ -46,4 +46,5 @@ OFTEST(dcmfg_fgbase_fgunknown) FGUnknown* fg_copy = OFstatic_cast(FGUnknown*, fg.clone()); OFCHECK(fg_copy != NULL); OFCHECK(fg.compare(*fg_copy) == 0); + delete fg_copy; } diff --git a/dcmseg/tests/tutils.cc b/dcmseg/tests/tutils.cc index 37405859f..aefce6677 100644 --- a/dcmseg/tests/tutils.cc +++ b/dcmseg/tests/tutils.cc @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2015-2024, OFFIS e.V. + * Copyright (C) 2015-2025, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation were developed by @@ -72,6 +72,7 @@ OFTEST(dcmseg_packBinaryFrame) OFCHECK_MSG(packed->pixData[2] == 0b00010000, OFString("Expected 0b00010000, got ") + DcmSegUtils::debugByte2Bin(packed->pixData[2])); OFCHECK_MSG(packed->pixData[3] == 0b01000010, OFString("Expected 0b01000010, got ") + DcmSegUtils::debugByte2Bin(packed->pixData[3])); OFCHECK_MSG(packed->pixData[4] == 0b00000000, OFString("Expected 0b00000000, got ") + DcmSegUtils::debugByte2Bin(packed->pixData[4])); + delete packed; // In 1000 iterations create sparse frames and pack them. Check whether the // packed frame is correct. This is not bullet proof but we use the same addressing @@ -206,6 +207,10 @@ OFTEST(dcmseg_concatBinaryFrames) OFCHECK_MSG(pixData[0] == 0b11111111, OFString("Expected 0b11111111, got ") + DcmSegUtils::debugByte2Bin(pixData[0])); OFCHECK_MSG(pixData[1] == 0b11101111, OFString("Expected 0b11101111, got ") + DcmSegUtils::debugByte2Bin(pixData[1])); OFCHECK_MSG(pixData[2] == 0b11111111, OFString("Expected 0b11111111, got ") + DcmSegUtils::debugByte2Bin(pixData[2])); + // avoid memory leaks + delete packed1; + delete packed2; + delete[] pixData; } // Test DcmSegUtils::debugByte2Bin()