17 lines
569 B
C++
17 lines
569 B
C++
|
#include <string>
|
||
|
#include <gtest/gtest.h>
|
||
|
|
||
|
#include "requests.h"
|
||
|
|
||
|
TEST(RequestsTest, HttpsGetTest) {
|
||
|
requestsInit();
|
||
|
std::string expected = "<!DOCTYPE html>\n<html >\n<head><meta charset=\"utf-8\">\n<title>Ben Shiller</title>";
|
||
|
for (int i = 0; i < 10; ++i) {
|
||
|
GetRequestResult result = requestGet("https://shillerben.com");
|
||
|
// std::cout << "GET https://shillerben.com returned: " << result.data << '\n';
|
||
|
ASSERT_EQ(strncmp(result.data, expected.c_str(), expected.size()), 0);
|
||
|
free(result.data);
|
||
|
}
|
||
|
requestsCleanup();
|
||
|
}
|