X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2Ftests%2Fmemcached%2Fparser.cpp;h=20fbed415e5d74613be5fad9dd139df3f8c57ba9;hb=2dd79b61ec7944b82ec6b576cc081603ec526049;hp=ca7fa4001237a13d089564dc7c52b7f04402118e;hpb=03ba544b4ef8a00bd4d51dfde1ed2bfb477096dc;p=awesomized%2Flibmemcached diff --git a/test/tests/memcached/parser.cpp b/test/tests/memcached/parser.cpp index ca7fa400..20fbed41 100644 --- a/test/tests/memcached/parser.cpp +++ b/test/tests/memcached/parser.cpp @@ -1,6 +1,9 @@ #include "test/lib/common.hpp" #include "test/lib/env.hpp" +#include "libmemcached/common.h" +#include "test/fixtures/parser.hpp" + TEST_CASE("memcached_parser") { SECTION("fail: null string") { REQUIRE_FALSE(memcached(nullptr, 123)); @@ -31,4 +34,18 @@ TEST_CASE("memcached_parser") { REQUIRE_FALSE(memcached(nullptr, 0)); } } + + SECTION("fixtures") { + for (const auto &test : tests) { + DYNAMIC_SECTION(test.name) { + for (size_t i = 0; i < test.ntests; ++i) { + auto &tc = test.tests[i]; + DYNAMIC_SECTION(tc.option.c_str) { + MemcachedPtr memc(memcached(tc.option.c_str, tc.option.size)); + test.check(*memc, tc.result); + } + } + } + } + } }