Project

General

Profile

バグ #3650

実行周期を0に設定してもエラーコードを返さない問題

Added by n-miyamoto over 4 years ago. Updated over 3 years ago.

Status:
終了
Priority:
通常
Assignee:
Start date:
10/05/2016
Due date:
% Done:

100%

Estimated time:

Description

setRate関数の引数に0を指定した場合にはRTC::BAD_PARAMETERを返すのが本来の仕様だが、ExecutionContextProfileクラスのsetRate関数内でrate < 0.0と判定しているため0の時にRTC::RTC_OKを返してしまう問題が発生する。
またsetPeriod関数内でも同様の判定をしているため修正する。

RTC::ReturnCode_t ExecutionContextProfile::setRate(double rate)
{
    RTC_TRACE(("setRate(%f)", rate));
    if (rate < 0.0) { return RTC::BAD_PARAMETER; }

    Guard guard(m_profileMutex);
    m_profile.rate = rate;
    m_period = coil::TimeValue(1.0/rate);
    return RTC::RTC_OK;
}

RTC::ReturnCode_t ExecutionContextProfile::setPeriod(coil::TimeValue period)
{
    RTC_TRACE(("setPeriod(%f [sec])", (double)period));
    if ((double)period < 0.0) { return RTC::BAD_PARAMETER; }

    Guard guard(m_profileMutex);
    m_profile.rate = 1.0 / (double)period;
    m_period = period;
    return RTC::RTC_OK;
}

Associated revisions

Revision 2777 (diff)
Added by n-ando over 4 years ago

[compat,->RELENG_1_2] Execution rate and period check has been modified. refs #3650

Revision 2777 (diff)
Added by n-ando over 4 years ago

[compat,->RELENG_1_2] Execution rate and period check has been modified. refs #3650

History

#1 Updated by n-ando over 4 years ago

  • Assignee set to n-ando
  • Target version set to RELENG_1_2
  • % Done changed from 0 to 100

rate/periodのチェックを 0.0 以上かどうか、を、0.0より大きいかどうかに変更。

#2 Updated by n-ando over 3 years ago

  • Status changed from 新規 to 終了

Also available in: Atom PDF