-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development #2
base: main
Are you sure you want to change the base?
Development #2
Conversation
…_DeltaFlex into development
Create cmake.yml
…_DeltaFlex into development
…_DeltaFlex into development
…_DeltaFlex into development
…_DeltaFlex into development
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошие тесты, напишите мне если у вас есть вопросы по умным указателям, засчитываю на 10
|
||
TEST(EvolutionTest, test_selectionCountOne) | ||
{ | ||
DFWorldScene *sc = new DFWorldScene(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
утечка памяти, создавайте на стеке или через unique_ptr
DFWorldScene *sc = new DFWorldScene(); | ||
std::vector<Model*> stickmans; | ||
|
||
for (int i = 0; i < 1; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем цикл? ++i
for (int i = 0; i < 1; i++) | ||
{ | ||
DFEntity &stickman = sc->addNewObject("stickman_" + std::to_string(i)); | ||
stickman.addComponent(new StickmanPhysicsComponent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нет new/delete - нет утечек
evo.Selection(); | ||
evo.getBestCount(); | ||
|
||
EXPECT_EQ(evo.getBestCount(), 7); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не совсем понятно почему 7 но ладно, не помешал бы комментарий
Link l(pm1, pm2, 10, 10, true); | ||
|
||
auto oldLen = pm1.m_pos - pm2.m_pos; | ||
float dist = oldLen.length(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ожидаемое значение должно вычисляться гарантировано работающим правильно кодом, еще лучше не вычислять его а просто захардкодить. В противном случае вы тестируете вашу логику против вашей логики
|
||
std::array<float, 11> res = {-0.103591, 0.604108, -0.986522, -0.997239, 0.971981, -0.5389, 0.903677, 0.916517, -0.162188, 0.974992, -0.864615}; | ||
|
||
for (int i = 0; i < 11; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res.size()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошие тесты, напишите мне если у вас есть вопросы по умным указателям, засчитываю на 10
engine and tests