| 8 | namespace ProfileSettingTests |
| 9 | { |
| 10 | class ProfileSettingEx : public ProfileSetting |
| 11 | { |
| 12 | public: |
| 13 | ProfileSettingEx(const std::wstring& path) |
| 14 | : ProfileSetting(path) |
| 15 | { |
| 16 | // any left over from previous run |
| 17 | RemoveProfileFile(); |
| 18 | } |
| 19 | |
| 20 | ~ProfileSettingEx() |
| 21 | { |
| 22 | RemoveProfileFile(); |
| 23 | } |
| 24 | |
| 25 | bool ReadValue(const std::wstring& section, const std::wstring& key, int& retVal, int defaultVal = 0) const |
| 26 | { |
| 27 | return Profile::ReadValue(section, key, retVal, defaultVal); |
| 28 | } |
| 29 | |
| 30 | bool ReadValue(const std::wstring& section, const std::wstring& key, std::wstring& retVal, const std::wstring& defaultVal = {}) const |
| 31 | { |
| 32 | return Profile::ReadValue(section, key, retVal, defaultVal); |
| 33 | } |
| 34 | |
| 35 | bool WriteValue(const std::wstring& section, const std::wstring& key, int value) const |
| 36 | { |
| 37 | return Profile::WriteValue(section, key, value); |
| 38 | } |
| 39 | |
| 40 | bool WriteValue(const std::wstring& section, const std::wstring& key, const std::wstring& value) const |
| 41 | { |
| 42 | return Profile::WriteValue(section, key, value); |
| 43 | } |
| 44 | |
| 45 | private: |
| 46 | void RemoveProfileFile() |
| 47 | { |
| 48 | std::error_code ec {}; |
| 49 | std::filesystem::remove(m_ProfileFilePath, ec); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | class ProfileTest : public ::testing::Test |
| 54 | { |
nothing calls this directly
no outgoing calls
no test coverage detected