We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb7b228 commit 777b7c8Copy full SHA for 777b7c8
src/energy/test/generic-battery-test.cc
@@ -51,17 +51,23 @@ DischargeBatteryTestCase::DoRun()
51
batteryModel->AppendDeviceEnergyModel(consumptionEnergyModel);
52
consumptionEnergyModel->SetNode(node);
53
54
+ // Needed to initialize battery model
55
+ batteryModel->UpdateEnergySource();
56
+
57
// Discharge the battery with a constant current of 2.33 A (1C)
58
consumptionEnergyModel->SetCurrentA(2.33);
59
60
Simulator::Stop(Seconds(3459));
61
Simulator::Run();
- Simulator::Destroy();
62
63
NS_TEST_ASSERT_MSG_EQ_TOL(batteryModel->GetSupplyVoltage(),
64
3.0,
65
1.0e-2,
66
"Cutoff voltage not reached");
67
+ node->Dispose();
68
+ consumptionEnergyModel->Dispose();
69
+ batteryModel->Dispose();
70
+ Simulator::Destroy();
71
}
72
73
/**
0 commit comments