Commit ce2cf1fa by Marcus Winter

tasks_cpp: removed code that was commented out in the tests

parent ed0b89da
...@@ -39,8 +39,7 @@ struct result_example_struct { ...@@ -39,8 +39,7 @@ struct result_example_struct {
typedef struct result_example_struct result_example_t; typedef struct result_example_struct result_example_t;
static void testGroupAction(embb::tasks::TaskContext & /*context*/) { static void testGroupAction(embb::tasks::TaskContext & /*context*/) {
//std::cout << "testGroupAction on core " << // emtpy
// context.GetCurrentCoreNumber() << std::endl;
} }
static void testDoSomethingElse() { static void testDoSomethingElse() {
...@@ -51,24 +50,18 @@ GroupTest::GroupTest() { ...@@ -51,24 +50,18 @@ GroupTest::GroupTest() {
} }
void GroupTest::TestBasic() { void GroupTest::TestBasic() {
//std::cout << "running testGroup..." << std::endl;
embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID); embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID);
embb::tasks::Node & node = embb::tasks::Node::GetInstance(); embb::tasks::Node & node = embb::tasks::Node::GetInstance();
embb::tasks::Group & group = node.CreateGroup(); embb::tasks::Group & group = node.CreateGroup();
embb::tasks::Task task; embb::tasks::Task task;
//std::cout << "wait all..." << std::endl;
for (int ii = 0; ii < 4; ii++) { for (int ii = 0; ii < 4; ii++) {
task = group.Spawn(testGroupAction); task = group.Spawn(testGroupAction);
} }
testDoSomethingElse(); testDoSomethingElse();
group.WaitAll(MTAPI_INFINITE); group.WaitAll(MTAPI_INFINITE);
//std::cout << "wait any..." << std::endl;
for (int ii = 0; ii < 4; ii++) { for (int ii = 0; ii < 4; ii++) {
task = group.Spawn(mtapi_task_id_t(ii + 1), testGroupAction); task = group.Spawn(mtapi_task_id_t(ii + 1), testGroupAction);
} }
...@@ -76,7 +69,7 @@ void GroupTest::TestBasic() { ...@@ -76,7 +69,7 @@ void GroupTest::TestBasic() {
mtapi_status_t status; mtapi_status_t status;
mtapi_task_id_t result; mtapi_task_id_t result;
while (MTAPI_SUCCESS == (status = group.WaitAny(MTAPI_INFINITE, result))) { while (MTAPI_SUCCESS == (status = group.WaitAny(MTAPI_INFINITE, result))) {
//std::cout << "got a result from task " << result << std::endl; // empty
} }
node.DestroyGroup(group); node.DestroyGroup(group);
...@@ -84,5 +77,4 @@ void GroupTest::TestBasic() { ...@@ -84,5 +77,4 @@ void GroupTest::TestBasic() {
embb::tasks::Node::Finalize(); embb::tasks::Node::Finalize();
PT_EXPECT_EQ(embb_get_bytes_allocated(), 0u); PT_EXPECT_EQ(embb_get_bytes_allocated(), 0u);
//std::cout << "...done" << std::endl << std::endl;
} }
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
#define QUEUE_TEST_ID 17 #define QUEUE_TEST_ID 17
static void testQueueAction(embb::tasks::TaskContext & /*context*/) { static void testQueueAction(embb::tasks::TaskContext & /*context*/) {
//std::cout << "testQueueAction on core " << // empty
// context.GetCurrentCoreNumber() << std::endl;
} }
static void testDoSomethingElse() { static void testDoSomethingElse() {
...@@ -48,8 +47,6 @@ QueueTest::QueueTest() { ...@@ -48,8 +47,6 @@ QueueTest::QueueTest() {
} }
void QueueTest::TestBasic() { void QueueTest::TestBasic() {
//std::cout << "running testQueue..." << std::endl;
embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID); embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID);
embb::tasks::Node & node = embb::tasks::Node::GetInstance(); embb::tasks::Node & node = embb::tasks::Node::GetInstance();
...@@ -66,5 +63,4 @@ void QueueTest::TestBasic() { ...@@ -66,5 +63,4 @@ void QueueTest::TestBasic() {
embb::tasks::Node::Finalize(); embb::tasks::Node::Finalize();
PT_EXPECT_EQ(embb_get_bytes_allocated(), 0u); PT_EXPECT_EQ(embb_get_bytes_allocated(), 0u);
//std::cout << "...done" << std::endl << std::endl;
} }
...@@ -40,8 +40,6 @@ static void testTaskAction( ...@@ -40,8 +40,6 @@ static void testTaskAction(
char const * msg, char const * msg,
std::string * output, std::string * output,
embb::tasks::TaskContext & /*context*/) { embb::tasks::TaskContext & /*context*/) {
//std::cout << "testTaskAction " << msg << " on core " <<
// context.GetCurrentCoreNumber() << std::endl;
*output = msg; *output = msg;
} }
...@@ -71,8 +69,6 @@ TaskTest::TaskTest() { ...@@ -71,8 +69,6 @@ TaskTest::TaskTest() {
} }
void TaskTest::TestBasic() { void TaskTest::TestBasic() {
//std::cout << "running testTask..." << std::endl;
embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID); embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID);
embb::tasks::Node & node = embb::tasks::Node::GetInstance(); embb::tasks::Node & node = embb::tasks::Node::GetInstance();
...@@ -96,7 +92,6 @@ void TaskTest::TestBasic() { ...@@ -96,7 +92,6 @@ void TaskTest::TestBasic() {
testDoSomethingElse(); testDoSomethingElse();
task.Wait(MTAPI_INFINITE); task.Wait(MTAPI_INFINITE);
PT_EXPECT(test == "simple"); PT_EXPECT(test == "simple");
//std::cout << "result: " << test.c_str() << std::endl;
std::string test1, test2, test3; std::string test1, test2, test3;
task = node.First( task = node.First(
...@@ -112,9 +107,6 @@ void TaskTest::TestBasic() { ...@@ -112,9 +107,6 @@ void TaskTest::TestBasic() {
PT_EXPECT(test1 == "first"); PT_EXPECT(test1 == "first");
PT_EXPECT(test2 == "second"); PT_EXPECT(test2 == "second");
PT_EXPECT(test3 == "third"); PT_EXPECT(test3 == "third");
//std::cout << "result1: " << test1.c_str() << std::endl;
//std::cout << "result2: " << test2.c_str() << std::endl;
//std::cout << "result3: " << test3.c_str() << std::endl;
int value = 0; int value = 0;
task = node.Spawn( task = node.Spawn(
...@@ -132,5 +124,4 @@ void TaskTest::TestBasic() { ...@@ -132,5 +124,4 @@ void TaskTest::TestBasic() {
embb::tasks::Node::Finalize(); embb::tasks::Node::Finalize();
PT_EXPECT(embb_get_bytes_allocated() == 0); PT_EXPECT(embb_get_bytes_allocated() == 0);
//std::cout << "...done" << std::endl << std::endl;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment