fixed memory leak
This commit is contained in:
@ -2,11 +2,19 @@
|
||||
// Created by StanislausCichocki on 10.03.2025.
|
||||
//
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include "../../src/services/Surplus.h"
|
||||
#include "../../src/services/Cost/BillCharge.h"
|
||||
#include "../../src/services/Cost/CalculateFinalSums.h"
|
||||
#include "../../src/services/Cost/CostPipeline.h"
|
||||
#include "../../src/services/Cost/NetworkProvider.h"
|
||||
#include "../../src/services/Cost/ServiceCharge.h"
|
||||
#include "../../src/services/Cost/GridCost/MeasurementServiceFee.h"
|
||||
#include "../../src/services/Cost/GridCost/NetUsagePerformance.h"
|
||||
#include "doctest/doctest.h"
|
||||
#include "../model/Factory.h"
|
||||
#include "../../src/Config.h"
|
||||
|
||||
TEST_CASE("Testing add function") {
|
||||
std::vector<std::unique_ptr<Community> > communities;
|
||||
@ -17,5 +25,13 @@ TEST_CASE("Testing add function") {
|
||||
surplus.CalculateSurplus();
|
||||
CostPipeline costPipeline(communities);
|
||||
costPipeline.addCostComponent(std::make_shared<NetworkProvider>());
|
||||
costPipeline.addCostComponent(std::make_shared<BillCharge>());
|
||||
costPipeline.addCostComponent(std::make_shared<MeasurementServiceFee>());
|
||||
costPipeline.addCostComponent(std::make_shared<NetUsagePerformance>());
|
||||
costPipeline.addCostComponent(std::make_shared<ServiceCharge>());
|
||||
costPipeline.addCostComponent(std::make_shared<CalculateFinalSums>());
|
||||
costPipeline.calculateFinalCost();
|
||||
|
||||
LOG_DEBUG_INFO("{}",communities[0]->total);
|
||||
CHECK(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user