Ticket #5977 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

Equals for Units

Reported by: Owen Arnold Owned by: Dan Nixon
Priority: minor Milestone: Release 3.3
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester:

Description

You currently have to compare units on the basis of ID, Would be nice to have member and non-member Equals operators to do this comparison.

Change History

comment:1 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.3 to Release 2.4

Moved to release 2.4

comment:2 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.4 to Release 2.5

Moved at the code freeze for release 2.4

comment:3 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:4 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:5 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to the Backlog after the code freeze for R2.6

comment:6 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

bulk move to assigned at the into of the triage step

comment:7 Changed 6 years ago by Dan Nixon

  • Owner changed from Anyone to Dan Nixon

comment:8 Changed 6 years ago by Dan Nixon

  • Status changed from assigned to inprogress

comment:9 Changed 6 years ago by Dan Nixon

Added equality and inequality opertors to Unit

Refs #5977

Changeset: c4676565738ebcd1e44ea7beca7c820497a25ef7

comment:10 Changed 6 years ago by Dan Nixon

Added equality and inequality operators (==, !=) to Unit base class and unit tests for both operators.

comment:11 Changed 6 years ago by Dan Nixon

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

comment:12 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to reopened
  • Resolution fixed deleted

The changes to the UnitTest test have caused some memory leaks that are shown in the valgrind checks: http://builds.mantidproject.org/view/Valgrind/job/valgrind_develop_core_packages/95/valgrindResult/pid=10104,0x7/

The pointers returned from the .clone() methods just need to delete the returned pointers.

As a point of style concerning auto: It should only give the type and a pointer or reference should still include * or & to signify this. So the energy clone line would be

auto *e1 = Energy().clone();

then the delete further down.

comment:13 Changed 6 years ago by Dan Nixon

Fixed issues mentioned in two further commits (which don't seem to be showing here).

comment:14 Changed 6 years ago by Dan Nixon

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

comment:15 Changed 6 years ago by Peter Parker

Dan, one of the commits contained "Refs #5799" instead of 5977. No idea where the other one went, as that had the correct ticket number. Both have been correctly published and checkbuilt, though.

comment:16 Changed 6 years ago by Peter Parker

  • Milestone changed from Backlog to Release 3.3

comment:17 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to closed

Merge remote-tracking branch 'origin/bugfix/5977_unit_equals_operator'

Full changeset: 28ce74287b0479020134953fbf9ae6865ed08b10

comment:18 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6823

Note: See TracTickets for help on using tickets.