2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-27 02:43:28 +00:00
rules_foreign_cc/examples/third_party/cares/c-ares-test.cpp
Javier Maestro be14ccaec5
chore: more precommit hooks (#1325)
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
2024-11-27 01:20:16 +00:00

16 lines
359 B
C++

#include "ares.h"
#include <iostream>
#include <stdexcept>
#include <string.h>
int main(int argc, char* argv[])
{
int version = 0;
const char* strVersion = ares_version(&version);
if (strcmp(strVersion, "1.14.0") != 0) {
throw std::runtime_error("Wrong version: " + std::string(strVersion));
}
std::cout << "C-ares version: " << strVersion;
}