Opened 7 years ago

Closed 7 years ago

#2302 closed defect (fixed)

bugs in src/lib/cc/data.h (Element::find does not return value and getValue does not work for ConstElementPtr)

Reported by: fujiwara Owned by: muks
Priority: medium Milestone: Sprint-20121023
Component: ~Inter-module communication(obsolete) Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Two bugs in src/lib/cc/data.h

  1. Element::find() does not return value because its argument is not a reference.
  2. getValue() member functions does not work for ConstElementPointer? because getValue() member functions are not specified as const.

tests and fixes are attached.

Aharen found these bugs.

Subtickets

Attachments (1)

data.h.diff (6.8 KB) - added by fujiwara 7 years ago.
tests and fixes

Download all attachments as: .zip

Change History (11)

Changed 7 years ago by fujiwara

tests and fixes

comment:1 Changed 7 years ago by jelte

  • Milestone changed from New Tasks to Sprint-20121023

comment:2 Changed 7 years ago by muks

  • Owner set to muks
  • Status changed from new to assigned

Picking

comment:3 Changed 7 years ago by muks

  • Owner changed from muks to fujiwara

This looks fine to me. I have created the trac2302 branch and added a minor whitespace cleanup patch on top. Please go ahead and merge it.

comment:4 Changed 7 years ago by muks

  • Status changed from assigned to reviewing

comment:5 Changed 7 years ago by fujiwara

test cases I attached are only cases which cause errors.
Please add test cases for various cases and types.

comment:6 Changed 7 years ago by fujiwara

  • Owner changed from fujiwara to muks

comment:7 Changed 7 years ago by muks

  • Owner changed from muks to fujiwara

Tests were added for different types. A couple of tests were also expanded. I changed the code to use a templated function instead.

comment:8 Changed 7 years ago by fujiwara

Thanks for adding tests.
I don't know there are enough tests, but tests are enhanced.
Please go ahead.

comment:9 Changed 7 years ago by fujiwara

  • Owner changed from fujiwara to muks

comment:10 Changed 7 years ago by muks

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged to master in commit 932edbb0ec8a4dbb820c6cccf4a0becd9df533c2:

* 55178c9 [2302] Add a set test for map Element
* 7bb6309 [2302] Check map data
* fd45bcd [2302] Add ConstElementPtr version of tests for all types of Element
* 2975fba [2302] Untabify and delete trailing whitespace
* 593b348 [2302] Fix bugs in Element class

Resolving as fixed. Thank you for the reviews fujiwara san.

Note: See TracTickets for help on using tickets.