Bug 1096 - PacketMetadata::Enable () always gets called
PacketMetadata::Enable () always gets called
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: test framework
ns-3.10
All All
: P5 normal
Assigned To: Mathieu Lacage
:
Depends on: 1192
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-07 05:05 EDT by Marc Reichelt
Modified: 2014-11-14 17:27 EST (History)
3 users (show)

See Also:


Attachments
Simple program where PacketMetadata::Enable () gets called (444 bytes, text/x-c++src)
2011-04-07 05:05 EDT, Marc Reichelt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Reichelt 2011-04-07 05:05:56 EDT
Created attachment 1062 [details]
Simple program where PacketMetadata::Enable () gets called

The method to enable gets called every time, even when writing a very simple program (see attachment). As I need the packet metadata system to be turned off due to bug #1072, I inserted a call to NS_FATAL_ERROR in packet-metadata.cc in the PacketMetadata::Enable () method. There I found that packet metadata gets enabled here:
http://code.nsnam.org/ns-3-dev/file/63a8a4ed4054/src/test/ns3tcp/ns3tcp-loss-test-suite.cc#l435

When "Ns3TcpLossTestSuite ns3TcpLossTestSuite;" is executed, it calls the constructor, which in turn enables the packet metadata. My guess is that this should probably not be executed. Simply removing the line fixes this issue for me.
Comment 1 Gustavo J. A. M. Carneiro 2011-04-07 05:56:40 EDT
This is on ns-3-dev or ns-3.10?  Because, as far as I can tell, in ns-3-dev unit tests are now in separate modules, which are not even linked by default, therefore in theory this bug should be already fixed in ns-3-dev...
Comment 2 Marc Reichelt 2011-04-07 06:31:38 EDT
I currently use a ns-3-dev snapshot from January (so actually it should be something like ns-3.10). I didn't check the current ns-3-dev branch, so it might be fixed there already as you said. Then I guess this bug may be closed. :-)
Comment 3 Tom Henderson 2011-08-09 16:09:35 EDT
this may be related to 1192; am assigning to Mathieu
Comment 4 Claudio 2011-08-10 03:41:16 EDT
The patch in 1192 moves the Enable calls to the Setup phase of the test cases, so this would be fixed by that patch.

BUT, as Gustavo said, in ns-3-dev tests are not linked into the core libraries. This bug should not happen at all in ns-3-dev.
Comment 5 Tom Henderson 2014-11-14 17:27:04 EST
this seems to have been fixed somewhere along the way, so marking it resolved.