Skip to content

Commit

Permalink
Change code style in memory_unittest.cc (#148)
Browse files Browse the repository at this point in the history
* style: change code style in memory_unittest.cc
  • Loading branch information
sonullx authored Nov 9, 2020
1 parent 158a9b3 commit dd8053b
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions test/memory_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
Copyright (c) 2020 Sogou, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: Liu Yang ([email protected])
*/

#include <vector>
#include <gtest/gtest.h>
#include "workflow/WFTaskFactory.h"
Expand All @@ -6,37 +24,37 @@ TEST(memory_unittest, dismiss)
{
std::vector<SubTask *> tasks;

auto http_task = WFTaskFactory::create_http_task("https://sogou.com", 0, 0, nullptr);
auto *http_task = WFTaskFactory::create_http_task("http://www.sogou.com", 0, 0, nullptr);
tasks.push_back(http_task);

auto redis_task = WFTaskFactory::create_redis_task("redis://username:[email protected]:6676/1", 0, nullptr);
auto *redis_task = WFTaskFactory::create_redis_task("redis://username:[email protected]:6676/1", 0, nullptr);
tasks.push_back(redis_task);

auto mysql_task = WFTaskFactory::create_mysql_task("mysql://username:[email protected]:8899/db", 0, nullptr);
auto *mysql_task = WFTaskFactory::create_mysql_task("mysql://username:[email protected]:8899/db", 0, nullptr);
tasks.push_back(mysql_task);

auto timer_task = WFTaskFactory::create_timer_task(0, nullptr);
auto *timer_task = WFTaskFactory::create_timer_task(0, nullptr);
tasks.push_back(timer_task);

auto counter_task = WFTaskFactory::create_counter_task("", 0, nullptr);
auto *counter_task = WFTaskFactory::create_counter_task("", 0, nullptr);
tasks.push_back(counter_task);

auto go_task = WFTaskFactory::create_go_task("", [](){});
auto *go_task = WFTaskFactory::create_go_task("", [](){});
tasks.push_back(go_task);

auto thread_task = WFThreadTaskFactory<int, int>::create_thread_task("", [](int *, int *){}, nullptr);
auto *thread_task = WFThreadTaskFactory<int, int>::create_thread_task("", [](int *, int *){}, nullptr);
tasks.push_back(thread_task);

auto graph_task = WFTaskFactory::create_graph_task(nullptr);
auto &node_a = graph_task->create_graph_node(WFTaskFactory::create_timer_task(0, nullptr));
auto &node_b = graph_task->create_graph_node(WFTaskFactory::create_timer_task(0, nullptr));
auto *graph_task = WFTaskFactory::create_graph_task(nullptr);
auto& node_a = graph_task->create_graph_node(WFTaskFactory::create_timer_task(0, nullptr));
auto& node_b = graph_task->create_graph_node(WFTaskFactory::create_timer_task(0, nullptr));
node_a -->-- node_b;
tasks.push_back(graph_task);

auto parallel_work = Workflow::create_parallel_work(nullptr);
for (auto task : tasks)
auto *parallel_work = Workflow::create_parallel_work(nullptr);
for (auto *task : tasks)
{
auto series_work = Workflow::create_series_work(task, nullptr);
auto *series_work = Workflow::create_series_work(task, nullptr);
parallel_work->add_series(series_work);
}

Expand Down

0 comments on commit dd8053b

Please sign in to comment.