suikan4github / murasaki

STM32 HAL class library
MIT License
18 stars 3 forks source link

SaiPortAdaptor::GetSampleWordSizeTx() check coverage is not complete. #92

Closed suikan4github closed 4 years ago

suikan4github commented 4 years ago

Describe the bug SaiPortAdaptor::GetSampleWordSizeTx() and SaiPortAdaptor::GetSampleWordSizeRx() checks only the SAI_SLOTSIZE_32B. This is not engouth

unsigned int SaiPortAdaptor::GetSampleWordSizeTx()
{
    SAIAUDIO_SYSLOG("Enter.")
    MURASAKI_ASSERT(tx_peripheral_ != nullptr)

    unsigned int return_val =
            (tx_peripheral_->SlotInit.SlotSize == SAI_SLOTSIZE_32B) ? 4 : 2;

    SAIAUDIO_SYSLOG("Exit with %d.", return_val)
    return return_val;
}

Expected behavior Have to check all formats. If there is unexpected value, it should raise assert.

suikan4github commented 4 years ago

Ready to release.