diff --git a/src/uan/test/uan-energy-model-test.cc b/src/uan/test/uan-energy-model-test.cc index 2656b6a1a..faaedf47a 100644 --- a/src/uan/test/uan-energy-model-test.cc +++ b/src/uan/test/uan-energy-model-test.cc @@ -40,23 +40,47 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("UanEnergyModelTestSuite"); +/** + * \ingroup uan-test + * \defgroup uan-test uan module tests + */ + + +/** + * \ingroup uan-test + * \ingroup tests + * + * \brief Acoustic Modem Energy Test Case + */ class AcousticModemEnergyTestCase : public TestCase { public: AcousticModemEnergyTestCase (); ~AcousticModemEnergyTestCase (); + /** + * Receive packet function + * \param dev the device + * \param pkt the packet + * \param mode the mode + * \param sender the address of the sender + * \returns true if successful + */ bool RxPacket (Ptr dev, Ptr pkt, uint16_t mode, const Address &sender); + /** + * Send one packet function + * \param node the node to send to + */ void SendOnePacket (Ptr node); void DoRun (void); - double m_simTime; - uint32_t m_bytesRx; - uint32_t m_sentPackets; - uint32_t m_packetSize; - Ptr m_node; - Ptr m_gateway; + double m_simTime; ///< simulation time + uint32_t m_bytesRx; ///< bytes received + uint32_t m_sentPackets; ///< number of sent packets + uint32_t m_packetSize; ///< packet size + Ptr m_node; ///< node + Ptr m_gateway; ///< the gateway }; AcousticModemEnergyTestCase::AcousticModemEnergyTestCase () @@ -189,21 +213,32 @@ AcousticModemEnergyTestCase::DoRun () Simulator::Destroy (); } +/** + * \ingroup uan-test + * \ingroup tests + * + * \brief Acoustic Modem Energy Depletion Test Case + */ class AcousticModemEnergyDepletionTestCase : public TestCase { public: AcousticModemEnergyDepletionTestCase (); ~AcousticModemEnergyDepletionTestCase (); + /// Depletion handler function void DepletionHandler (void); + /** + * Send one packet function + * \param node the node to send to + */ void SendOnePacket (Ptr node); void DoRun (void); - double m_simTime; - uint32_t m_callbackCount; - uint32_t m_packetSize; - Ptr m_node; + double m_simTime; ///< Simulation time + uint32_t m_callbackCount; ///< callback count + uint32_t m_packetSize; ///< packet size + Ptr m_node; ///< the node }; AcousticModemEnergyDepletionTestCase::AcousticModemEnergyDepletionTestCase () @@ -291,7 +326,10 @@ AcousticModemEnergyDepletionTestCase::DoRun (void) // -------------------------------------------------------------------------- // /** - * Unit test suite for underwater energy model. Include test on acoustic modem, + * \ingroup uan-test + * \ingroup tests + * + * \brief Unit test suite for underwater energy model. Include test on acoustic modem, * acoustic modem energy depletion. */ class UanEnergyModelTestSuite : public TestSuite diff --git a/src/uan/test/uan-test.cc b/src/uan/test/uan-test.cc index 43832d605..ab1fa0ed9 100644 --- a/src/uan/test/uan-test.cc +++ b/src/uan/test/uan-test.cc @@ -34,6 +34,12 @@ using namespace ns3; +/** + * \ingroup uan-test + * \ingroup tests + * + * \brief Uan Test + */ class UanTest : public TestCase { public: @@ -41,13 +47,47 @@ public: virtual void DoRun (void); private: + /** + * Create node function + * \param pos the position of the device + * \param chan the communication channel + * \returns the UAN device + */ Ptr CreateNode (Vector pos, Ptr chan); + /** + * Phy test function + * \returns true if successful + */ bool DoPhyTests (); + /** + * Do one Phy test function + * \param t1 the time to send first packet + * \param t2 the time to send the second packet + * \param r1 first distance constant + * \param r2 second distance constant + * \param prop the propagation model + * \param mode1 the send mode for device 1 + * \param mode2 the send mode for device 2 + * \returns number of bytes received + */ uint32_t DoOnePhyTest (Time t1, Time t2, uint32_t r1, uint32_t r2, Ptr prop, uint32_t mode1 = 0, uint32_t mode2 = 0); + /** + * Receive packet function + * \param dev the device + * \param pkt the packet + * \param mode the receive mode + * \param sender the address of the sender + * \returns true if successful + */ bool RxPacket (Ptr dev, Ptr pkt, uint16_t mode, const Address &sender); + /** + * Send one packet function + * \param dev the device + * \param mode the transmit mode + */ void SendOnePacket (Ptr dev, uint32_t mode); - ObjectFactory m_phyFac; - uint32_t m_bytesRx; + ObjectFactory m_phyFac; ///< Phy + uint32_t m_bytesRx; ///< byes received }; @@ -240,7 +280,12 @@ UanTest::DoRun (void) DoPhyTests (); } - +/** + * \ingroup uan-test + * \ingroup tests + * + * \brief Uan Test Suite + */ class UanTestSuite : public TestSuite { public: @@ -253,8 +298,5 @@ UanTestSuite::UanTestSuite () AddTestCase (new UanTest, TestCase::QUICK); } -static UanTestSuite g_uanTestSuite; - - - +static UanTestSuite g_uanTestSuite; ///< the test suite