Opened 7 years ago

Closed 6 years ago

#3073 closed enhancement (fixed)

[kean] Add empty() method to Element

Reported by: muks Owned by: kean
Priority: medium Milestone: Sprint-20131015
Component: configuration Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Some places such as Session::hasQueuedMsgs() test for emptiness by calling Element::size(), which wraps around the underlying data structure. We should add empty() as a wrapper around the underlying empty() method for these cases.

Subtickets

Change History (12)

comment:1 Changed 7 years ago by muks

  • Estimated Difficulty changed from 0 to 3

comment:2 Changed 6 years ago by muks

  • Milestone changed from Next-Sprint-Proposed to Sprint-20130903
  • Summary changed from Add empty() method to Element to [kean] Add empty() method to Element

comment:3 Changed 6 years ago by kean

  • Owner set to kean
  • Status changed from new to accepted

comment:4 Changed 6 years ago by kean

  • Owner changed from kean to UnAssigned
  • Status changed from accepted to reviewing

comment:5 Changed 6 years ago by muks

  • Owner changed from UnAssigned to kean

Hi Kean

make check fails on this branch. Was it run in your local environment before putting the branch to review?

[----------] 36 tests from ListTestMapped/ListTest
[ RUN      ] ListTestMapped/ListTest.emptyReset/0
[       OK ] ListTestMapped/ListTest.emptyReset/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.selfTest/0
[       OK ] ListTestMapped/ListTest.selfTest/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.emptyList/0
[       OK ] ListTestMapped/ListTest.emptyList/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.emptySearch/0
[       OK ] ListTestMapped/ListTest.emptySearch/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.singleDSExactMatch/0
[       OK ] ListTestMapped/ListTest.singleDSExactMatch/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.singleDSBestMatch/0
[       OK ] ListTestMapped/ListTest.singleDSBestMatch/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.multiExactMatch/0
[       OK ] ListTestMapped/ListTest.multiExactMatch/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.multiBestMatch/0
[       OK ] ListTestMapped/ListTest.multiBestMatch/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.configureEmpty/0
client_list_unittest.cc:512: Failure
Value of: list_->getConfiguration()
  Actual: 0x1d71a50
Expected: elem
Which is: 0x1d7e800
[  FAILED  ] ListTestMapped/ListTest.configureEmpty/0, where GetParam() = 0x79a7e8 (0 ms)
[ RUN      ] ListTestMapped/ListTest.configureMulti/0
[       OK ] ListTestMapped/ListTest.configureMulti/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.configureParams/0
[       OK ] ListTestMapped/ListTest.configureParams/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.status/0
[       OK ] ListTestMapped/ListTest.status/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.wrongConfig/0
client_list_unittest.cc:680: Failure
Expected: list_->configure(elem, true) throws an exception of type ConfigurableClientList::ConfigurationError.
  Actual: it throws a different type.
Google Test trace:
client_list_unittest.cc:677: {}
client_list_unittest.cc:680: Failure
Expected: list_->configure(elem, true) throws an exception of type ConfigurableClientList::ConfigurationError.
  Actual: it throws a different type.
Google Test trace:
client_list_unittest.cc:677: true
client_list_unittest.cc:680: Failure
Expected: list_->configure(elem, true) throws an exception of type ConfigurableClientList::ConfigurationError.
  Actual: it throws a different type.
Google Test trace:
client_list_unittest.cc:677: 42
client_list_unittest.cc:680: Failure
Expected: list_->configure(elem, true) throws an exception of type ConfigurableClientList::ConfigurationError.
  Actual: it throws a different type.
Google Test trace:
client_list_unittest.cc:677: null
[  FAILED  ] ListTestMapped/ListTest.wrongConfig/0, where GetParam() = 0x79a7e8 (2 ms)
[ RUN      ] ListTestMapped/ListTest.defaults/0
[       OK ] ListTestMapped/ListTest.defaults/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reconfigure/0
client_list_unittest.cc:704: Failure
Value of: list_->getDataSources().empty()
  Actual: false
Expected: true
[  FAILED  ] ListTestMapped/ListTest.reconfigure/0, where GetParam() = 0x79a7e8 (0 ms)
[ RUN      ] ListTestMapped/ListTest.dataSrcError/0
[       OK ] ListTestMapped/ListTest.dataSrcError/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.dataSrcLibraryError/0
[       OK ] ListTestMapped/ListTest.dataSrcLibraryError/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.configureCacheEmpty/0
[       OK ] ListTestMapped/ListTest.configureCacheEmpty/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.configureCacheDisabled/0
[       OK ] ListTestMapped/ListTest.configureCacheDisabled/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.cacheZones/0
[       OK ] ListTestMapped/ListTest.cacheZones/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.badCache/0
[       OK ] ListTestMapped/ListTest.badCache/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.cacheInNonWritableSegment/0
[       OK ] ListTestMapped/ListTest.cacheInNonWritableSegment/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.masterFiles/0
[       OK ] ListTestMapped/ListTest.masterFiles/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.names/0
[       OK ] ListTestMapped/ListTest.names/0 (2 ms)
[ RUN      ] ListTestMapped/ListTest.BadMasterFile/0
[       OK ] ListTestMapped/ListTest.BadMasterFile/0 (2 ms)
[ RUN      ] ListTestMapped/ListTest.checkZoneWriterCatchesExceptions/0
[       OK ] ListTestMapped/ListTest.checkZoneWriterCatchesExceptions/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.checkZoneWriterThrows/0
[       OK ] ListTestMapped/ListTest.checkZoneWriterThrows/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reloadSuccess/0
[       OK ] ListTestMapped/ListTest.reloadSuccess/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.reloadNotEnabled/0
[       OK ] ListTestMapped/ListTest.reloadNotEnabled/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reloadNoSuchZone/0
[       OK ] ListTestMapped/ListTest.reloadNoSuchZone/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.reloadZoneGone/0
[       OK ] ListTestMapped/ListTest.reloadZoneGone/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reloadNewZone/0
[       OK ] ListTestMapped/ListTest.reloadNewZone/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reloadZoneThrow/0
[       OK ] ListTestMapped/ListTest.reloadZoneThrow/0 (1 ms)
[ RUN      ] ListTestMapped/ListTest.reloadNullIterator/0
[       OK ] ListTestMapped/ListTest.reloadNullIterator/0 (0 ms)
[ RUN      ] ListTestMapped/ListTest.reloadMasterFile/0
[       OK ] ListTestMapped/ListTest.reloadMasterFile/0 (11 ms)
[ RUN      ] ListTestMapped/ListTest.reloadByDataSourceName/0
[       OK ] ListTestMapped/ListTest.reloadByDataSourceName/0 (1 ms)
[----------] 36 tests from ListTestMapped/ListTest (27 ms total)

comment:6 Changed 6 years ago by kean

Yes it was. I also ran make distcheck. I will re-run it to see what is going on.

comment:7 Changed 6 years ago by kean

  • Owner changed from kean to muks

comment:8 Changed 6 years ago by muks

  • Owner changed from muks to kean

There is no commentary here. What happened? Was there a problem? What am I supposed to do with this ticket? :)

comment:9 Changed 6 years ago by kean

Sorry I thought the git comment would suffice. I fixed the test failures by removing some changes that shouldn't have been part of the original commit.

comment:10 Changed 6 years ago by kean

  • Owner changed from kean to muks

comment:11 Changed 6 years ago by muks

  • Owner changed from muks to kean

It looks good now. ChangeLog is unnecessary as this has no user-noticeable changes. Please go ahead and merge.

comment:12 Changed 6 years ago by kean

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.