Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CPP Ecosystem Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RIVOAL Samuel
CPP Ecosystem Project
Commits
f0df97dc
Commit
f0df97dc
authored
4 years ago
by
fuzzy_bunny
Browse files
Options
Downloads
Patches
Plain Diff
fixed unworking PetFactory test because of dynamic allocation
parent
c57593ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testPetFactory.cpp
+7
-19
7 additions, 19 deletions
tests/testPetFactory.cpp
with
7 additions
and
19 deletions
tests/testPetFactory.cpp
+
7
−
19
View file @
f0df97dc
...
...
@@ -19,28 +19,16 @@ int main(){
map
<
string
,
float
>
animalsDistribution
=
{{
KamikazeBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
100
}};
map
<
string
,
float
>
animalsDistribution2
=
{{
KamikazeBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
50
},
{
FearfulBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
50
}};
map
<
string
,
float
>
animalsDistribution3
=
{{
KamikazeBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
30
},
{
FearfulBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
30
},
{
GregariousBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
20
},
{
"multiple"
,
20
}};
map
<
string
,
float
>
animalsDistribution3
=
{{
KamikazeBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
30
},
{
FearfulBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
30
},
{
GregariousBehaviour
::
getBehaviourInstance
()
->
getBehaviourName
(),
20
},
{
"
b_
multiple"
,
20
}};
Aquarium
*
ecosystem
=
new
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution
);
ecosystem
->
run
();
//usleep(5*pow(10,6));
//ecosystem.close();
Aquarium
ecosystem
=
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution
);
ecosystem
.
run
();
delete
ecosystem
;
Aquarium
*
ecosystem2
=
new
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution2
);
ecosystem2
->
run
();
//usleep(5*pow(10,6));
//ecosystem2.close();
Aquarium
ecosystem2
=
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution2
);
ecosystem2
.
run
();
delete
ecosystem2
;
Aquarium
*
ecosystem3
=
new
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution3
);
ecosystem3
->
run
();
//usleep(5*pow(10,6));
//ecosystem3.close();
delete
ecosystem3
;
Aquarium
ecosystem3
=
Aquarium
(
windowWidth
,
windowHeight
,
delay
,
startingNbPets
,
animalsDistribution3
);
ecosystem3
.
run
();
return
0
;}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment