Rename timer `Setup` function to `Schedule`
This patch was motivated by my desire to fix a typo in the function
name. The noun "setup" is 1 word. The verb "set up" is 2 words. All
other member functions are verbs, so this one should be a verb too.
That means that the function should be called `SetUp`. During the
discussion that resulted from the rename, James Kuszmaul pointed out
that "setting up" a timer can be confusing. It implies that you can
only "set up" a timer once. But the intent is to let users set up
timers as many times as they like. So we decided on renaming the
function to `Schedule`. That conveys the purpose and intent better.
I took this opportunity to fix some other typos involving the verb
"set up".
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I2f557d1f946960af82711f248820d5e2d385a5d3
diff --git a/aos/starter/starter_test.cc b/aos/starter/starter_test.cc
index 37efa98..fcbf287 100644
--- a/aos/starter/starter_test.cc
+++ b/aos/starter/starter_test.cc
@@ -35,8 +35,8 @@
starter->Cleanup();
}
})
- ->Setup(starter->event_loop()->monotonic_now(),
- std::chrono::milliseconds(100));
+ ->Schedule(starter->event_loop()->monotonic_now(),
+ std::chrono::milliseconds(100));
}
gflags::FlagSaver flag_saver_;
@@ -109,7 +109,7 @@
watcher_loop.Exit();
FAIL();
})
- ->Setup(watcher_loop.monotonic_now() + std::chrono::seconds(7));
+ ->Schedule(watcher_loop.monotonic_now() + std::chrono::seconds(7));
std::atomic<int> test_stage = 0;
// Watch on the client loop since we need to interact with the StarterClient.
@@ -228,7 +228,7 @@
watcher_loop.Exit();
FAIL();
})
- ->Setup(watcher_loop.monotonic_now() + std::chrono::seconds(11));
+ ->Schedule(watcher_loop.monotonic_now() + std::chrono::seconds(11));
int test_stage = 0;
uint64_t id;
@@ -323,7 +323,7 @@
watcher_loop.Exit();
FAIL();
})
- ->Setup(watcher_loop.monotonic_now() + std::chrono::seconds(7));
+ ->Schedule(watcher_loop.monotonic_now() + std::chrono::seconds(7));
int pong_running_count = 0;
watcher_loop.MakeWatcher("/aos", [&watcher_loop, &pong_running_count](
@@ -420,7 +420,7 @@
watcher_loop.Exit();
SUCCEED();
})
- ->Setup(watcher_loop.monotonic_now() + std::chrono::seconds(11));
+ ->Schedule(watcher_loop.monotonic_now() + std::chrono::seconds(11));
int test_stage = 0;
uint64_t id;
@@ -521,7 +521,7 @@
"The chain of stages defined below did not complete "
"within the time limit.";
})
- ->Setup(client_loop.monotonic_now() + std::chrono::seconds(20));
+ ->Schedule(client_loop.monotonic_now() + std::chrono::seconds(20));
// variables have been defined, here we define the body of the test.
// We want stage1 to succeed, triggering stage2.
@@ -570,8 +570,8 @@
LOG(INFO) << "End stage1";
};
// start the test body
- client_loop.AddTimer(stage1)->Setup(client_loop.monotonic_now() +
- std::chrono::milliseconds(1));
+ client_loop.AddTimer(stage1)->Schedule(client_loop.monotonic_now() +
+ std::chrono::milliseconds(1));
// prepare the cleanup for starter. This will finish when we call
// `test_done_ = true;`.