readingDataHandlerStringAS::getAge does not properly check for the age units
Issue #317
resolved
The check for the age units is wrong.
char unit = ageString[3];
if(
unit != (char)ageUnit_t::days &&
unit != (char)ageUnit_t::weeks &&
unit == (char)ageUnit_t::months &&
unit == (char)ageUnit_t::years)
{
IMEBRA_THROW(DataHandlerCorruptedBufferError, "The AGE unit should be D, W, M or Y but is ascii code "<< (int)unit);
}
should be:
char unit = ageString[3];
if(
unit != (char)ageUnit_t::days &&
unit != (char)ageUnit_t::weeks &&
unit != (char)ageUnit_t::months &&
unit != (char)ageUnit_t::years)
{
IMEBRA_THROW(DataHandlerCorruptedBufferError, "The AGE unit should be D, W, M or Y but is ascii code "<< (int)unit);
}
Comments (4)
-
reporter -
reporter Addresses
#317. Added getAge test→ <<cset dc7d833e1f3a>>
-
reporter Addresses
#317. Updated changes log→ <<cset 490ae72eb6bf>>
-
reporter - changed status to resolved
Resolves
#317(readingDataHandlerStringAS::getAge does not properly check for the age units) as per SOP FIXBUG/2→ <<cset efc52db53c16>>
- Log in to comment
Addresses
#317. Corrected check for units in getAge()→ <<cset a7a6b5c9d2b1>>