Project

General

Profile

Actions

Bug #2660

closed

Exclude::excludeOne: incorrect for default-constructed Name::Component

Added by Junxiao Shi almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
03/20/2015
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Snippet to reproduce:

// g++ -std=c++0x x.cpp $(pkg-config --cflags --libs libndn-cxx)
#include <ndn-cxx/name.hpp>
#include <ndn-cxx/exclude.hpp>

using ndn::Name;
using ndn::Exclude;

int
main()
{
  std::cout << (Name::Component() == Name::Component("") ? 1 : 0) << std::endl;
  std::cout << Name::Component() << std::endl;
  std::cout << Name::Component("") << std::endl;
  std::cout << (Exclude().excludeOne(Name::Component()) == Exclude().excludeOne(Name::Component("")) ? 1 : 0) << std::endl;
  std::cout << Exclude().excludeOne(Name::Component()) << std::endl;
  std::cout << Exclude().excludeOne(Name::Component("")) << std::endl;

  return 0;
}

Expected output:

1
...
...
1
...
...

Actual output:

1
...
...
0

...

Despite that Name::Component() equals Name::Component(""), Exclude::excludeOne is treating them differently.

Actions #1

Updated by Alex Afanasyev over 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Alex Afanasyev
  • % Done changed from 0 to 50
Actions #2

Updated by Alex Afanasyev over 9 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 50 to 100
  • Estimated time set to 1.00 h
Actions #3

Updated by Alex Afanasyev over 9 years ago

  • Status changed from Code review to Closed

Applied in changeset commit:ndn-cpp-dev|c076e6d3e1cec478fbd36fa696f5d49ff00949c6.

Actions

Also available in: Atom PDF