Ticket #8142 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Instrument::numMonitors() returns zero for parameterized instrument

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: trivial Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description

When working on #8108, I discovered that I had to go through Instrument::baseInstrument() for this method to return the right answer.

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #8142. Add a failing test that exposes the bug.

And a passing one in InstrumentTest (for a non-parameterized instrument) as that's missing.

Changeset: 1d8fe7e9e4ebb77d0499cf0b04634060479d7fec

comment:2 Changed 7 years ago by Russell Taylor

Re #8142. Add pass-through to base instrument if appropriate.

This fixes the issue of always getting zero back for a parameterized instrument.

Changeset: 936620cc485aef206aef41bc4a7692d3e3ec0808

comment:3 Changed 7 years ago by Russell Taylor

Re #8142. Fix coverity issues.

The base component (m_base) has to be of type Instrument; therefore use a static_cast in place of a dynamic one.

Changeset: 11931d9795c1b21491d1e3500c735341ff580165

comment:4 Changed 7 years ago by Russell Taylor

  • Owner set to Russell Taylor

comment:5 Changed 7 years ago by Russell Taylor

  • Milestone changed from Backlog to Release 3.0

comment:6 Changed 7 years ago by Russell Taylor

  • Status changed from inprogress to verify
  • Resolution set to fixed

Tester: Branch is bugfix/8142_nummonitors_fix

The fix is covered by unit tests - it should be sufficient to look at the code changes and verify that they look clean and correct. You can also satisfy yourself that you agree with where I've changed dynamic to static casts. It's just not possible for m_base to not be an Instrument, and coverity pointed out that it doesn't really make sense to use a dynamic_cast if you're not going to check whether it succeeded (or in this case it doesn't make sense to use it if it can't fail).

comment:7 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:8 Changed 7 years ago by Nick Draper

Changes approved by code inspection

comment:9 Changed 7 years ago by Nick Draper

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/8142_nummonitors_fix'

Full changeset: e99fcd7647cf6e43b15756f336d5dada9af4f0f2

comment:10 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8987

Note: See TracTickets for help on using tickets.