style: run clang-format and configure pre-commit hooks

This commit is contained in:
AI-anonymous
2026-05-20 00:18:23 +02:00
parent 041eab7155
commit 3b15770437
28 changed files with 2226 additions and 2061 deletions

View File

@@ -1,28 +1,28 @@
#include <gtest/gtest.h>
#include "fces/population.hpp"
#include <gtest/gtest.h>
using namespace fces;
TEST(PopulationTest, Construction) {
Population pop(50);
EXPECT_EQ(pop.size(), 50);
Population pop(50);
EXPECT_EQ(pop.size(), 50);
}
TEST(PopulationTest, DirectConstruction) {
Population pop(200, 10000, EliteStrategy::Cumulative,
false, false, false, false, false, true);
EXPECT_EQ(pop.size(), 1);
Population pop(200, 10000, EliteStrategy::Cumulative, false, false, false,
false, false, true);
EXPECT_EQ(pop.size(), 1);
}
TEST(PopulationTest, GetBestActive) {
Population pop(10);
auto& best = pop.get_best_active();
// Should not crash
EXPECT_GE(best.id, 0u);
Population pop(10);
auto &best = pop.get_best_active();
// Should not crash
EXPECT_GE(best.id, 0u);
}
TEST(PopulationTest, CalmDown) {
Population pop(10);
pop.calm_down();
EXPECT_LT(pop.global_sigma_modifier(), 1.0f);
Population pop(10);
pop.calm_down();
EXPECT_LT(pop.global_sigma_modifier(), 1.0f);
}