Use a mock to test locale support

This commit is contained in:
Victor Zverovich
2016-05-19 15:04:25 -07:00
parent ebff26f8f1
commit e2a332e5df
3 changed files with 29 additions and 14 deletions
+7 -1
View File
@@ -29,7 +29,7 @@
#define FMT_GTEST_EXTRA_H_
#include <string>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "fmt/format.h"
@@ -172,4 +172,10 @@ std::string read(fmt::File &f, std::size_t count);
#endif // FMT_USE_FILE_DESCRIPTORS
template <typename Mock>
struct ScopedMock : testing::StrictMock<Mock> {
ScopedMock() { Mock::instance = this; }
~ScopedMock() { Mock::instance = 0; }
};
#endif // FMT_GTEST_EXTRA_H_