View | Details | Raw Unified | Return to bug 2447
Collapse All | Expand All

(-)a/src/core/model/object-factory.cc (-1 / +15 lines)
 Lines 139-146    Link Here 
139
  NS_ASSERT (lbracket != std::string::npos);
139
  NS_ASSERT (lbracket != std::string::npos);
140
  NS_ASSERT (rbracket != std::string::npos);
140
  NS_ASSERT (rbracket != std::string::npos);
141
  std::string tid = v.substr (0, lbracket);
141
  std::string tid = v.substr (0, lbracket);
142
  factory.SetTypeId (tid);
142
  std::string parameters = v.substr (lbracket+1,rbracket-(lbracket+1));
143
  std::string parameters = v.substr (lbracket+1,rbracket-(lbracket+1));
143
  factory.SetTypeId (tid);
144
  bool invalidDelimiter = false;
145
  if (parameters.find (',', 0) != std::string::npos)
146
    {
147
      invalidDelimiter = true;
148
    }
149
  if (parameters.find (':', 0) != std::string::npos)
150
    {
151
      invalidDelimiter = true;
152
    }
153
  if (invalidDelimiter == true)
154
    {
155
      is.setstate (std::ios_base::failbit);
156
      return is;
157
    }
144
  std::string::size_type cur;
158
  std::string::size_type cur;
145
  cur = 0;
159
  cur = 0;
146
  while (cur != parameters.size ())
160
  while (cur != parameters.size ())
(-)a/src/core/test/attribute-test-suite.cc (-6 / +2 lines)
 Lines 823-839    Link Here 
823
  //
823
  //
824
  // Try to set a UniformRandomVariable
824
  // Try to set a UniformRandomVariable
825
  //
825
  //
826
  ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::UniformRandomVariable[Min=0.,Max=1.]"));
826
  ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::UniformRandomVariable[Min=0.|Max=1.]"));
827
  NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a UniformRandomVariable");
827
  NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a UniformRandomVariable");
828
828
829
  //
829
  //
830
  // Try to set a <snicker> ConstantRandomVariable
830
  // Try to set a <snicker> ConstantRandomVariable
831
  //
831
  //
832
  //  ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::ConstantRandomVariable[Constant=10.0]"));
832
  ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::ConstantRandomVariable[Constant=10.0]"));
833
  //ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::UniformRandomVariable[Min=0.,Max=1.]"));
834
835
  ok = p->SetAttributeFailSafe ("TestRandom", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
836
837
  NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a ConstantRandomVariable");
833
  NS_TEST_ASSERT_MSG_EQ (ok, true, "Could not SetAttributeFailSafe() a ConstantRandomVariable");
838
}
834
}
839
835

Return to bug 2447