Skip to content

Commit

Permalink
Fix Windows warnings in test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Dec 8, 2021
1 parent 5b693d7 commit 975bd60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/test_cases/gpu/test_cuda_simulation_concurrency.cu
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ float meanSimulationTime(const int REPETITIONS, CUDASimulation &s, std::vector<A
total_time += s.getElapsedTimeSimulation();
}
}
return total_time / REPETITIONS;
return static_cast<float>(total_time / REPETITIONS);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cases/gpu/test_cuda_submacroenvironment.cu
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TEST(SubCUDAMacroEnvironmentTest, MasterWriteSubReadHost) {
}
auto& agt = m.newAgent("test");
auto& sm = m.newSubModel("sub", m2);
auto& senv = sm.SubEnvironment(true);
sm.SubEnvironment(true);
m.newLayer().addHostFunction(Host_Write_5);
m.newLayer().addSubModel(sm);
AgentVector pop(agt, 1);
Expand Down
16 changes: 8 additions & 8 deletions tests/test_cases/runtime/test_spatial_agent_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST(AutomaticSpatialAgentSort, SortingDisabled) {
MessageSpatial3D::Description &locationMessage = model.newMessage<MessageSpatial3D>("location");
locationMessage.setMin(-5, -5, -5);
locationMessage.setMax(5, 5, 5);
locationMessage.setRadius(0.2);
locationMessage.setRadius(0.2f);
AgentFunctionDescription& dummyFunc = agent.newFunction("dummySpatialFunc", dummySpatialFunc);
dummyFunc.setMessageInput("location");
LayerDescription& layer = model.newLayer();
Expand All @@ -38,9 +38,9 @@ TEST(AutomaticSpatialAgentSort, SortingDisabled) {
for (int i = 0; i< static_cast<int>(AGENT_COUNT); i++) {
AgentVector::Agent instance = pop[i];
instance.setVariable<int>("initial_order", i);
instance.setVariable<float>("x", -i);
instance.setVariable<float>("y", -i);
instance.setVariable<float>("z", -i);
instance.setVariable<float>("x", static_cast<float>(-i));
instance.setVariable<float>("y", static_cast<float>(-i));
instance.setVariable<float>("z", static_cast<float>(-i));
}

// Setup Model
Expand Down Expand Up @@ -72,7 +72,7 @@ TEST(AutomaticSpatialAgentSort, SortEveryStep) {
MessageSpatial3D::Description &locationMessage = model.newMessage<MessageSpatial3D>("location");
locationMessage.setMin(-5, -5, -5);
locationMessage.setMax(5, 5, 5);
locationMessage.setRadius(0.2);
locationMessage.setRadius(0.2f);
AgentFunctionDescription& dummyFunc = agent.newFunction("dummySpatialFunc", dummySpatialFunc);
dummyFunc.setMessageInput("location");
LayerDescription& layer = model.newLayer();
Expand All @@ -83,9 +83,9 @@ TEST(AutomaticSpatialAgentSort, SortEveryStep) {
for (int i = 0; i< static_cast<int>(AGENT_COUNT); i++) {
AgentVector::Agent instance = pop[i];
instance.setVariable<int>("initial_order", i);
instance.setVariable<float>("x", -i);
instance.setVariable<float>("y", -i);
instance.setVariable<float>("z", -i);
instance.setVariable<float>("x", static_cast<float>(-i));
instance.setVariable<float>("y", static_cast<float>(-i));
instance.setVariable<float>("z", static_cast<float>(-i));
}

// Setup Model
Expand Down

0 comments on commit 975bd60

Please sign in to comment.