libcryfs/test/cli/program_options/testutils/ProgramOptionsTestBase.h
Sebastian Messmer 938528840b Added --unmount-idle command line option (without functionality yet)
And refactor cli (group Cli class and program_options in cli subfolder)
2015-11-12 11:43:39 -08:00

27 lines
866 B
C++

#pragma once
#ifndef MESSMER_CRYFS_TEST_PROGRAMOPTIONS_PROGRAMOPTIONSTEST_H
#define MESSMER_CRYFS_TEST_PROGRAMOPTIONS_PROGRAMOPTIONSTEST_H
#include <google/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