libcryfs/test/cryfs-cli/program_options/testutils/ProgramOptionsTestBase.h

27 lines
859 B
C
Raw Normal View History

2015-10-15 13:06:51 +02:00
#pragma once
#ifndef MESSMER_CRYFS_TEST_PROGRAMOPTIONS_PROGRAMOPTIONSTEST_H
#define MESSMER_CRYFS_TEST_PROGRAMOPTIONS_PROGRAMOPTIONSTEST_H
2016-02-11 16:39:42 +01:00
#include <gtest/gtest.h>
class ProgramOptionsTestBase: public ::testing::Test {
public:
std::vector<char*> options(std::initializer_list<const char*> options) {
std::vector<char*> result;
for (auto option : options) {
result.push_back(const_cast<char*>(option));
}
return result;
}
void EXPECT_VECTOR_EQ(std::initializer_list<const char*> expected, const std::vector<char*> &actual) {
std::vector<const char*> expectedVec(expected);
EXPECT_EQ(expectedVec.size(), actual.size());
for(unsigned int i = 0; i < expectedVec.size(); ++i) {
EXPECT_EQ(std::string(expectedVec[i]), std::string(actual[i]));
}
}
};
#endif