Browse Source

Test: utils.cc - move sleep_millis() to std_utils.cc

LIB-11
heck 1 year ago
parent
commit
9f579de001
5 changed files with 5 additions and 12 deletions
  1. +0
    -5
      test/framework/utils.cc
  2. +0
    -1
      test/framework/utils.hh
  3. +3
    -2
      test/pitytest11/test/test_execmodes.cc
  4. +0
    -1
      test/pitytest11/test/test_processdirs.cc
  5. +2
    -3
      test/pitytest11/test/test_transport.cc

+ 0
- 5
test/framework/utils.cc View File

@ -1,7 +1,2 @@
#include "utils.hh"
void sleep_millis(int milis) {
std::chrono::milliseconds timespan(milis);
std::this_thread::sleep_for(timespan);
}

+ 0
- 1
test/framework/utils.hh View File

@ -70,6 +70,5 @@
// ------------------------------------------------------------------------------------------------
void sleep_millis(int milis);
#endif // LIBPEPADAPTER_TEST_UTILS_HH

+ 3
- 2
test/pitytest11/test/test_execmodes.cc View File

@ -1,8 +1,9 @@
#include "../src/PityUnit.hh"
#include "../../framework/utils.hh"
#include "../../../src/std_utils.hh"
#include <iostream>
using namespace std;
using namespace pEp;
using namespace pEp::PityTest11;
void do_some_work(const PityUnit<>& myself, int sleepmilis, int rep_count)
@ -10,7 +11,7 @@ void do_some_work(const PityUnit<>& myself, int sleepmilis, int rep_count)
int i = 0;
while (i < rep_count) {
myself.log(myself.getName() + " - " + to_string(i));
sleep_millis(sleepmilis);
Utils::sleep_millis(sleepmilis);
i++;
}
}


+ 0
- 1
test/pitytest11/test/test_processdirs.cc View File

@ -1,5 +1,4 @@
#include "../src/PityUnit.hh"
#include "../../framework/utils.hh"
#include <iostream>
#include <algorithm>


+ 2
- 3
test/pitytest11/test/test_transport.cc View File

@ -1,5 +1,4 @@
#include "../src/PityUnit.hh"
#include "../../framework/utils.hh"
#include "../../../src/std_utils.hh"
#include <iostream>
#include <fstream>
@ -16,7 +15,7 @@ void send(const PityUnit<>& myself)
ofstream msgfile = Utils::file_create(myself.processDir() + "/transport.msg");
msgfile << "G4rbage" << endl;
msgfile.close();
sleep_millis(400000);
Utils::sleep_millis(400000);
}
void receive(const PityUnit<>& myself)
@ -24,7 +23,7 @@ void receive(const PityUnit<>& myself)
setenv("HOME", myself.processDir().c_str(), 1);
myself.log("HOME=" + string(getenv("HOME")));
// Utils::dir_list_files()
sleep_millis(400000);
Utils::sleep_millis(400000);
}
int main(int argc, char* argv[])


Loading…
Cancel
Save