Bug 1485 - Setting global properties in config file (raw text) does not have any effect
Setting global properties in config file (raw text) does not have any effect
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: config-store
ns-3-dev
All All
: P5 minor
Assigned To: Mitch Watrous
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-14 15:36 UTC by nsnam-bugzilla
Modified: 2012-08-29 11:51 UTC (History)
1 user (show)

See Also:


Attachments
Small example for reproducing the bug (772 bytes, text/x-c++src)
2012-08-14 15:36 UTC, nsnam-bugzilla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nsnam-bugzilla 2012-08-14 15:36:25 UTC
Created attachment 1434 [details]
Small example for reproducing the bug

When I set a global property like ChecksumEnabled in a config file and load this file by the ConfigStore, the property isn't set in the simulation. For example 'global ChecksumEnabled "true"' does not result in ChecksumEnabled set to true when running the simulation. Default properties like 'default ns3::UdpServer::Port "800"' are working as supposed.

Steps to reproduce:
 1) Create a file "config.txt" in the working folder with following content:
      global ChecksumEnabled "true"
      default ns3::UdpServer::Port "800"
 2) Run the attached script (config-store.cc)
 3) Examine the contents of "output-attributes.txt" and see that ChecksumEnabled was set to false instead of true. The UdpServer::Port is set to the correct value (which actually differs from the ns3-default)


It seems to be a problem with the methods 'void Default (void);' and 'void Global (void);' of RawTextConfig. These methods are called one by one in 'ConfigStore::ConfigureDefaults'. After calling the first method the member attribute 'm_is' is empty and therefore the second method returns without setting any config values. So if you change the sequence of the calls to the two methods (in 'ConfigStore::ConfigureDefaults'), global properties are set as supposed, while default properties aren't set anymore.
Comment 1 Mitch Watrous 2012-08-29 11:51:57 UTC
Bug closed.

ns-3-dev changeset: 800dfb523bfc