commit 375aa2688f8b153c12ef87d6438da6656610bbd4 from: Aleksey Ryndin date: Fri Aug 18 16:57:15 2023 UTC Tests refactored (like a test framework) commit - be734cf5e58ed36b967d5403df96a061b2126610 commit + 375aa2688f8b153c12ef87d6438da6656610bbd4 blob - 65402cd90a810a8d10d86b12a0d6ecf7d0c9eeea blob + 2dd66474221c65f42ae309860b37b772d385120f --- tests/test_parse_url.cc +++ tests/test_parse_url.cc @@ -8,12 +8,9 @@ namespace vostok { -int test_parse_url() -{ - int ret = 0; +TEST_START(test_parse_url) zs_url_path_t zs_url_path; - IS_TRUE(parse_url(cut_null("gemini://host"), zs_url_path) == url_ok); IS_TRUE(strcmp(zs_url_path.begin(), "") == 0); @@ -49,13 +46,8 @@ int test_parse_url() IS_TRUE(parse_url(cut_null("gemini://host/a/b/../c/./d"), zs_url_path) == url_ok); IS_TRUE(strcmp(zs_url_path.begin(), "a/c/d") == 0); +TEST_END() - if (ret == 0) - std::cout << __FUNCTION__ << " successfully passed!" << std::endl; - - return ret; -} - } // namespace vostok blob - afce9cc5b57c18bc8ba16f4a33292f2baffe5471 blob + e48bd425a7637201b650636bd242e1ed7409bdcd --- tests/tests.h +++ tests/tests.h @@ -1,3 +1,19 @@ #pragma once -#define IS_TRUE(x) if(!(x)){std::cout<<__FUNCTION__<<" failed on line "<<__LINE__<