reformat unittest sources with clang-format
This commit is contained in:
committed by
Richard Berger
parent
a8b60848c3
commit
569a000e6b
@ -13,12 +13,12 @@
|
||||
#ifndef TEST_EXTENSIONS__H
|
||||
#define TEST_EXTENSIONS__H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sys/types.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <vector>
|
||||
|
||||
static void delete_file(const std::string &filename)
|
||||
{
|
||||
@ -44,14 +44,15 @@ static bool equal_lines(const std::string &fileA, const std::string &fileB)
|
||||
std::string lineA, lineB;
|
||||
|
||||
while (std::getline(afile, lineA)) {
|
||||
if(!std::getline(bfile, lineB)) return false;
|
||||
if(lineA != lineB) return false;
|
||||
if (!std::getline(bfile, lineB)) return false;
|
||||
if (lineA != lineB) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::vector<std::string> read_lines(const std::string &filename) {
|
||||
static std::vector<std::string> read_lines(const std::string &filename)
|
||||
{
|
||||
std::vector<std::string> lines;
|
||||
std::ifstream infile(filename);
|
||||
std::string line;
|
||||
@ -62,7 +63,8 @@ static std::vector<std::string> read_lines(const std::string &filename) {
|
||||
return lines;
|
||||
}
|
||||
|
||||
static bool file_exists(const std::string &filename) {
|
||||
static bool file_exists(const std::string &filename)
|
||||
{
|
||||
struct stat result;
|
||||
return stat(filename.c_str(), &result) == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user