Project

General

Profile

Actions

Bug #4569

open

Default-constructed MetaInfo does not equal MetaInfo decoded with default values

Added by Junxiao Shi about 6 years ago. Updated over 4 years ago.

Status:
In Progress
Priority:
Normal
Category:
Base
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:

Description

Snippet to reproduce:

// g++ -std=c++11 -o x x.cpp $(pkg-config --cflags --libs libndn-cxx)

#include <iostream>

#include <ndn-cxx/encoding/block.hpp>
#include <ndn-cxx/meta-info.hpp>

int
main()
{
  static uint8_t WIRE[] = { 0x14, 0x03, 0x18, 0x01, 0x00 };
  ndn::MetaInfo a(ndn::Block(WIRE, sizeof(WIRE)));
  ndn::MetaInfo b;
  std::cout << static_cast<int>(a == b) << std::endl;
  return 0;
}

Expected: program prints 1, indicating a equals b.
Actual: program prints 0, indicating a does not equal b.

Actions

Also available in: Atom PDF