Fix tests.

GitOrigin-RevId: c8fd96e6538d86eeff67bf23e1eb6ddd2fd97d1f
This commit is contained in:
levlam 2018-05-19 23:45:13 +03:00
parent 8fb6edab2f
commit cb6456ce6d
8 changed files with 13 additions and 13 deletions

View File

@ -405,7 +405,7 @@ TEST(Actors, send_to_dead) {
} }
TEST(Actors, main_simple) { TEST(Actors, main_simple) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(DEBUG)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
ConcurrentScheduler sched; ConcurrentScheduler sched;
int threads_n = 3; int threads_n = 3;
@ -420,7 +420,7 @@ TEST(Actors, main_simple) {
} }
TEST(Actors, main) { TEST(Actors, main) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(DEBUG)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
ConcurrentScheduler sched; ConcurrentScheduler sched;
int threads_n = 9; int threads_n = 9;
@ -448,7 +448,7 @@ class DoAfterStop : public Actor {
}; };
TEST(Actors, do_after_stop) { TEST(Actors, do_after_stop) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(DEBUG)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
ConcurrentScheduler sched; ConcurrentScheduler sched;
int threads_n = 0; int threads_n = 0;

View File

@ -52,7 +52,7 @@ static FileLog file_log;
static TsLog ts_log(&file_log); static TsLog ts_log(&file_log);
void TestsRunner::init(string dir) { void TestsRunner::init(string dir) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(WARNING)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
chdir(dir).ensure(); chdir(dir).ensure();
LOG(WARNING) << "Redirect log into " << tag("file", dir + TD_DIR_SLASH + "log.txt"); LOG(WARNING) << "Redirect log into " << tag("file", dir + TD_DIR_SLASH + "log.txt");
if (file_log.init("log.txt", std::numeric_limits<int64>::max())) { if (file_log.init("log.txt", std::numeric_limits<int64>::max())) {

View File

@ -234,7 +234,7 @@ class BaselineKV {
}; };
TEST(DB, key_value) { TEST(DB, key_value) {
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(INFO)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
std::vector<std::string> keys; std::vector<std::string> keys;
std::vector<std::string> values; std::vector<std::string> values;
@ -409,7 +409,7 @@ TEST(DB, persistent_key_value) {
using KeyValue = BinlogKeyValue<ConcurrentBinlog>; using KeyValue = BinlogKeyValue<ConcurrentBinlog>;
// using KeyValue = PersistentKeyValue; // using KeyValue = PersistentKeyValue;
// using KeyValue = SqliteKV; // using KeyValue = SqliteKV;
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(WARNING)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
std::vector<std::string> keys; std::vector<std::string> keys;
std::vector<std::string> values; std::vector<std::string> values;
CSlice name = "test_pmc"; CSlice name = "test_pmc";

View File

@ -129,7 +129,7 @@ TEST(Http, reader) {
return; return;
#endif #endif
clear_thread_locals(); clear_thread_locals();
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(INFO)); SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
auto start_mem = BufferAllocator::get_buffer_mem(); auto start_mem = BufferAllocator::get_buffer_mem();
{ {
auto input_writer = ChainBufferWriter::create_empty(); auto input_writer = ChainBufferWriter::create_empty();

View File

@ -16,6 +16,7 @@
int main(int argc, char **argv) { int main(int argc, char **argv) {
// TODO port OptionsParser to Windows // TODO port OptionsParser to Windows
SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR));
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
if (!std::strcmp(argv[i], "--filter")) { if (!std::strcmp(argv[i], "--filter")) {
CHECK(i + 1 < argc); CHECK(i + 1 < argc);

View File

@ -39,9 +39,9 @@ TEST(MessageEntities, mention) {
check_mention("@abcdefghijklmnopqrstuvwxyz123456", {"@abcdefghijklmnopqrstuvwxyz123456"}); check_mention("@abcdefghijklmnopqrstuvwxyz123456", {"@abcdefghijklmnopqrstuvwxyz123456"});
check_mention("@abcdefghijklmnopqrstuvwxyz1234567", {}); check_mention("@abcdefghijklmnopqrstuvwxyz1234567", {});
check_mention("нет@mention", {}); check_mention("нет@mention", {});
check_mention("@ya @gif @wiki @vid @bing @pic @bold @imdb @coub @like @vote @giff @cap ya cap @y @yar @bingg @bin", check_mention(
{"@ya", "@gif", "@wiki", "@vid", "@bing", "@pic", "@bold", "@imdb", "@coub", "@like", "@vote", "@giff", "@ya @gif @wiki @vid @bing @pic @bold @imdb @coub @like @vote @giff @cap ya cap @y @yar @bingg @bin",
"@cap", "@bingg"}); {"@ya", "@gif", "@wiki", "@vid", "@bing", "@pic", "@bold", "@imdb", "@coub", "@like", "@vote", "@bingg"});
}; };
static void check_bot_command(string str, std::vector<string> expected) { static void check_bot_command(string str, std::vector<string> expected) {

View File

@ -127,7 +127,7 @@ class TestPingActor : public Actor {
return stop(); return stop();
} }
if (ping_connection_->was_pong()) { if (ping_connection_->was_pong()) {
LOG(ERROR) << "GOT PONG"; LOG(INFO) << "GOT PONG";
return stop(); return stop();
} }
} }

View File

@ -88,8 +88,7 @@ TEST(StringCleaning, strip_empty_characters) {
check_strip_empty_characters(empty, 1000000, ""); check_strip_empty_characters(empty, 1000000, "");
check_strip_empty_characters(empty + "a", 1000000, empty + "a"); check_strip_empty_characters(empty + "a", 1000000, empty + "a");
check_strip_empty_characters(spaces + empty + spaces + "abc" + spaces, 1000000, empty + spaces_replace + "abc"); check_strip_empty_characters(spaces + empty + spaces + "abc" + spaces, 1000000, empty + spaces_replace + "abc");
check_strip_empty_characters(spaces + spaces + empty + spaces + spaces + empty + empty, 1000000, check_strip_empty_characters(spaces + spaces + empty + spaces + spaces + empty + empty, 1000000, "");
empty + spaces_replace + spaces_replace + empty + empty);
check_strip_empty_characters("\r\r\r\r\r\r\r", 1000000, ""); check_strip_empty_characters("\r\r\r\r\r\r\r", 1000000, "");
check_strip_empty_characters("\r\n\r\n\r\n\r\n\r\n\r\n\r", 1000000, ""); check_strip_empty_characters("\r\n\r\n\r\n\r\n\r\n\r\n\r", 1000000, "");
check_strip_empty_characters(Slice(" \t\r\n\0\va\v\0\n\r\t ").str(), 1000000, "a"); check_strip_empty_characters(Slice(" \t\r\n\0\va\v\0\n\r\t ").str(), 1000000, "a");