-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
- Loading branch information
1 parent
b82efea
commit f4081e0
Showing
4 changed files
with
118 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#define CATCH_CONFIG_MAIN | ||
#include <catch.hpp> | ||
|
||
#include <iostream> | ||
|
||
#include "etcd/Client.hpp" | ||
|
||
static const std::string etcd_v4_url = | ||
etcdv3::detail::resolve_etcd_endpoints("http://127.0.0.1:2379"); | ||
static const std::string etcd_v6_url = | ||
etcdv3::detail::resolve_etcd_endpoints("http://::1:2379"); | ||
|
||
TEST_CASE("test ipv4 connection") { | ||
std::cout << "ipv4 endpoints: " << etcd_v4_url << std::endl; | ||
etcd::Client etcd(etcd_v4_url); | ||
REQUIRE(etcd.head().get().is_ok()); | ||
} | ||
|
||
TEST_CASE("test ipv6 connection") { | ||
std::cout << "ipv6 endpoints: " << etcd_v6_url << std::endl; | ||
etcd::Client etcd(etcd_v6_url); | ||
REQUIRE(etcd.head().get().is_ok()); | ||
} |