Skip to content

Commit

Permalink
passing test (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 2, 2019
1 parent 3793d50 commit 68b66a2
Show file tree
Hide file tree
Showing 18 changed files with 138 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, DISABLED_ExecutionWithDefaultStorageS

void BareMetalComputeServiceOneTaskTest::do_ExecutionWithDefaultStorageService_test() {
// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1143,7 +1143,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithPrePostCopiesTaskCleanup
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithPrePostCopiesTaskCleanup_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1286,7 +1286,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithPrePostCopiesNoTaskNoCle
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithPrePostCopiesNoTaskNoCleanup_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1410,7 +1410,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithPreNoPostCopiesNoTaskCle
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithPreNoPostCopiesNoTaskCleanup_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1535,7 +1535,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithMissingFile) {
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithMissingFile_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1658,7 +1658,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithNotEnoughCores) {
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithNotEnoughCores_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down Expand Up @@ -1779,7 +1779,7 @@ TEST_F(BareMetalComputeServiceOneTaskTest, ExecutionWithNotEnoughRAM) {
void BareMetalComputeServiceOneTaskTest::do_ExecutionWithNotEnoughRAM_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("one_task_test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ TEST_F(BareMetalComputeServiceTestPilotJobs, UnsupportedPilotJobs) {
void BareMetalComputeServiceTestPilotJobs::do_UnsupportedPilotJobs_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ DO_TEST_WITH_FORK(do_UnsupportedStandardJobs_test);
void BareMetalComputeServiceTestStandardJobs::do_UnsupportedStandardJobs_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -324,7 +324,7 @@ DO_TEST_WITH_FORK(do_BogusNumCores_test);
void BareMetalComputeServiceTestStandardJobs::do_BogusNumCores_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -449,7 +449,7 @@ DO_TEST_WITH_FORK(do_TwoSingleCoreTasks_test);
void BareMetalComputeServiceTestStandardJobs::do_TwoSingleCoreTasks_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -575,7 +575,7 @@ DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase1_test);
void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase1_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -713,7 +713,7 @@ DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase2_test);
void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase2_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -902,7 +902,7 @@ class BareMetalComputeServiceTwoDualCoreTasksCase3TestWMS : public wrench::WMS {
throw std::runtime_error("Error while getting and execution event: " + e.getCause()->toString());
}
if (std::dynamic_pointer_cast<wrench::StandardJobCompletedEvent>(event)) {
two_task_job_2_completion_date = simulation->getCurrentSimulatedDate();
two_task_job_2_completion_date = wrench::Simulation::getCurrentSimulatedDate();
// success, do nothing for now
} else {
throw std::runtime_error("Unexpected workflow execution event: " + event->toString());
Expand Down Expand Up @@ -936,7 +936,7 @@ DO_TEST_WITH_FORK(do_TwoDualCoreTasksCase3_test);
void BareMetalComputeServiceTestStandardJobs::do_TwoDualCoreTasksCase3_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BatchJobContiguousAllocationTestWMS : public wrench::WMS {
wrench::WorkflowTask *task4 = this->getWorkflow()->addTask(cs->getName() + "task4", 59, 1, 1, 1.0, 0);
wrench::StandardJob *job;

double start_time = this->simulation->getCurrentSimulatedDate();
double start_time = wrench::Simulation::getCurrentSimulatedDate();

// Submit a sequential task that lasts one min and requires 1 host
job = job_manager->createStandardJob(task1, {});
Expand Down Expand Up @@ -178,7 +178,7 @@ class BatchJobContiguousAllocationTestWMS : public wrench::WMS {
if (real_event) {
wrench::WorkflowTask *task = *(real_event->standard_job->getTasks().begin());
if (task == task4) {
double now = simulation->getCurrentSimulatedDate();
double now = wrench::Simulation::getCurrentSimulatedDate();
contiguous = (now >= start_time + 120);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class BatchJobBrokenEstimateWaitingTimeTestWMS : public wrench::WMS {
"Got some exception"
);
}
double first_job_running = this->simulation->getCurrentSimulatedDate();
double first_job_running = wrench::Simulation::getCurrentSimulatedDate();

auto batch_service = (*this->getAvailableComputeServices<wrench::BatchComputeService>().begin());
std::string job_id = "my_tentative_job";
Expand Down Expand Up @@ -355,7 +355,7 @@ class BatchJobBasicEstimateWaitingTimeTestWMS : public wrench::WMS {
"Got some exception"
);
}
auto first_job_running = this->simulation->getCurrentSimulatedDate();
auto first_job_running = wrench::Simulation::getCurrentSimulatedDate();

auto batch_service = (*this->getAvailableComputeServices<wrench::BatchComputeService>().begin());
std::string job_id = "my_tentative_job";
Expand Down Expand Up @@ -528,7 +528,7 @@ class BatchJobEstimateWaitingTimeTestWMS : public wrench::WMS {
"Got some exception"
);
}
double first_job_running = this->simulation->getCurrentSimulatedDate();
double first_job_running = wrench::Simulation::getCurrentSimulatedDate();


auto batch_service = (*this->getAvailableComputeServices<wrench::BatchComputeService>().begin());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class SimpleFCFSTestWMS : public wrench::WMS {
throw std::runtime_error("Error while getting and execution event: " + e.getCause()->toString());
}
if (std::dynamic_pointer_cast<wrench::StandardJobCompletedEvent>(event)) {
actual_completion_times[i] = this->simulation->getCurrentSimulatedDate();
actual_completion_times[i] = wrench::Simulation::getCurrentSimulatedDate();
} else {
throw std::runtime_error("Unexpected workflow execution event: " + event->toString());
}
Expand Down
30 changes: 15 additions & 15 deletions test/compute_services/BatchService/BatchServiceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class TwoStandardJobSubmissionTestWMS : public wrench::WMS {
//ignore (network error or something)
}

double completion_time = this->simulation->getCurrentSimulatedDate();
double completion_time = wrench::Simulation::getCurrentSimulatedDate();
double expected_completion_time;
if (job == standard_job_1) {
expected_completion_time = 1800;
Expand Down Expand Up @@ -1080,7 +1080,7 @@ TEST_F(BatchServiceTest, StandardPlusPilotJobSubmissionTest) {
void BatchServiceTest::do_StandardPlusPilotJobTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -1214,7 +1214,7 @@ TEST_F(BatchServiceTest, InsufficientCoresJobSubmissionTest) {
void BatchServiceTest::do_InsufficientCoresTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -1340,7 +1340,7 @@ TEST_F(BatchServiceTest, NoArgumentsJobSubmissionTest) {
void BatchServiceTest::do_noArgumentsJobSubmissionTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -1493,7 +1493,7 @@ TEST_F(BatchServiceTest, StandardJobTimeOutTaskTest) {
void BatchServiceTest::do_StandardJobTimeOutTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -1846,7 +1846,7 @@ TEST_F(BatchServiceTest, BestFitStandardJobSubmissionTest)
void BatchServiceTest::do_BestFitTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2010,7 +2010,7 @@ TEST_F(BatchServiceTest, FirstFitStandardJobSubmissionTest)
void BatchServiceTest::do_FirstFitTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2192,7 +2192,7 @@ class RoundRobinStandardJobSubmissionTestWMS : public wrench::WMS {

double EPSILON = 1.0;
double not_expected_date = 60; //FIRSTFIT and BESTFIT would complete in ~60 seconds but ROUNDROBIN would finish, in this case, in ~90 seconds
if (std::abs(this->simulation->getCurrentSimulatedDate() - not_expected_date) <= EPSILON) {
if (std::abs(wrench::Simulation::getCurrentSimulatedDate() - not_expected_date) <= EPSILON) {
throw std::runtime_error(
"BatchServiceTest::ROUNDROBINTEST():: The tasks did not finish on time: Simulation Date > Expected Date"
);
Expand Down Expand Up @@ -2282,7 +2282,7 @@ TEST_F(BatchServiceTest, RoundRobinTaskTest)
void BatchServiceTest::do_RoundRobinTask_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2465,7 +2465,7 @@ TEST_F(BatchServiceTest, StandardJobInsidePilotJobTimeOutTaskTest) {
void BatchServiceTest::do_StandardJobInsidePilotJobTimeOutTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2628,7 +2628,7 @@ TEST_F(BatchServiceTest, StandardJobInsidePilotJobSucessTaskTest) {
void BatchServiceTest::do_StandardJobInsidePilotJobSucessTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2782,7 +2782,7 @@ TEST_F(BatchServiceTest, InsufficientCoresInsidePilotJobTaskTest) {
void BatchServiceTest::do_InsufficientCoresInsidePilotJobTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -2924,7 +2924,7 @@ TEST_F(BatchServiceTest, MultipleStandardJobSubmissionTest) {
void BatchServiceTest::do_MultipleStandardTaskTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -3072,7 +3072,7 @@ TEST_F(BatchServiceTest, DISABLED_DifferentBatchAlgorithmsSubmissionTest)
void BatchServiceTest::do_DifferentBatchAlgorithmsSubmissionTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down Expand Up @@ -3230,7 +3230,7 @@ TEST_F(BatchServiceTest, ShutdownWithPendingRunningJobsTest)
void BatchServiceTest::do_ShutdownWithPendingRunningJobsTest_test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("batch_service_test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class WorkloadTraceFileSWFTestWMS : public wrench::WMS {
//ignore (network error or something)
}

double completion_time = this->simulation->getCurrentSimulatedDate();
double completion_time = wrench::Simulation::getCurrentSimulatedDate();
double expected_completion_time;
if (job == standard_job_2_nodes) {
expected_completion_time = 3600 + 1800;
Expand Down
2 changes: 1 addition & 1 deletion test/file_registry_services/FileRegistryTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ TEST_F(FileRegistryTest, LookupEntry) {
void FileRegistryTest::do_lookupEntry_Test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("file_registry_lookup_entry_test");
Expand Down
8 changes: 4 additions & 4 deletions test/network_proximity_services/NetworkProximityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ TEST_F(NetworkProximityTest, NetworkProximity) {
void NetworkProximityTest::do_NetworkProximity_Test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -403,7 +403,7 @@ TEST_F(NetworkProximityTest, CompareNetworkProximity) {
void NetworkProximityTest::do_CompareNetworkProximity_Test() {

// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -579,7 +579,7 @@ TEST_F(NetworkProximityTest, VivaldiConvergeTest) {

void NetworkProximityTest::do_VivaldiConverge_Test() {
// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down Expand Up @@ -684,7 +684,7 @@ TEST_F(NetworkProximityTest, NetworkProximityValidatePropertiesTest) {

void NetworkProximityTest::do_ValidateProperties_Test() {
// Create and initialize a simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();
int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
argv[0] = strdup("unit_test");
Expand Down
2 changes: 1 addition & 1 deletion test/simulation/S4U_DaemonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class S4U_DaemonTestWMS : public wrench::WMS {
// Join and check that we get to the right time
daemon->join();

double now = simulation->getCurrentSimulatedDate();
double now = wrench::Simulation::getCurrentSimulatedDate();
if (std::abs(now - 120) > 1) {
throw std::runtime_error("Joining at time " + std::to_string(now) + " instead of expected 120");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ TEST_F(DataMovementManagerCopyRegisterTest, CopyAndRegister) {

void DataMovementManagerCopyRegisterTest::do_CopyRegister_test() {
// Create and initialize the simulation
wrench::Simulation *simulation = new wrench::Simulation();
auto simulation = new wrench::Simulation();

int argc = 1;
char **argv = (char **) calloc(1, sizeof(char *));
Expand Down
Loading

0 comments on commit 68b66a2

Please sign in to comment.