Added back asserts to EutranMeasurementMapping
authorBudiarto Herman <budiarto.herman@magister.fi>
Thu, 17 Oct 2013 16:47:18 +0300
changeset 10378 d54dbdb31bdb
parent 10377 efe5d9a94cb9
child 10379 c61db1276872
Added back asserts to EutranMeasurementMapping
src/lte/model/lte-common.cc
--- a/src/lte/model/lte-common.cc	Thu Oct 17 16:45:42 2013 +0300
+++ b/src/lte/model/lte-common.cc	Thu Oct 17 16:47:18 2013 +0300
@@ -252,7 +252,10 @@
                                    << " for Hysteresis IE value");
     }
 
-  return (static_cast<double> (hysteresisIeValue) * 0.5);
+  double actual = static_cast<double> (hysteresisIeValue) * 0.5;
+  NS_ASSERT (actual >= 0.0);
+  NS_ASSERT (actual <= 15.0);
+  return actual;
 }
 
 uint8_t
@@ -265,7 +268,10 @@
                                    << " for hysteresis");
     }
 
-  return lround (hysteresisDb * 2.0);
+  uint8_t ieValue = lround (hysteresisDb * 2.0);
+  NS_ASSERT (ieValue >= 0);
+  NS_ASSERT (ieValue <= 30);
+  return ieValue;
 }
 
 double
@@ -278,7 +284,10 @@
                                    << " for a3-Offset IE value");
     }
 
-  return (static_cast<double> (a3OffsetIeValue) * 0.5);
+  double actual = static_cast<double> (a3OffsetIeValue) * 0.5;
+  NS_ASSERT (actual >= -15.0);
+  NS_ASSERT (actual <= 15.0);
+  return actual;
 }
 
 int8_t
@@ -291,7 +300,10 @@
                                    << " for A3 Offset");
     }
 
-  return lround (a3OffsetDb * 2.0);
+  uint8_t ieValue = lround (a3OffsetDb * 2.0);
+  NS_ASSERT (ieValue >= -30);
+  NS_ASSERT (ieValue <= 30);
+  return ieValue;
 }
 
 double
@@ -304,7 +316,10 @@
                                    << " for Q-RxLevMin IE value");
     }
 
-  return (static_cast<double> (qRxLevMinIeValue) * 2);
+  double actual = static_cast<double> (qRxLevMinIeValue) * 2;
+  NS_ASSERT (actual >= -140.0);
+  NS_ASSERT (actual <= -44.0);
+  return actual;
 }
 
 double
@@ -317,7 +332,10 @@
                                    << " for Q-QualMin IE value");
     }
 
-  return (static_cast<double> (qQualMinIeValue));
+  double actual = static_cast<double> (qQualMinIeValue);
+  NS_ASSERT (actual >= -34.0);
+  NS_ASSERT (actual <= -3.0);
+  return actual;
 }
 
 }; // namespace ns3