Merge pull request #173 from piponazo/fixGtestWarningsOnWindows

Provide a gtestWrapper header to skip useless warnings
This commit is contained in:
Luis Díaz Más 2017-11-25 09:28:03 +01:00 committed by GitHub
commit f0ee2b638c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,6 @@
add_executable(unit_tests mainTestRunner.cpp
test_types.cpp
gtestwrapper.h
)
#TODO Use GTest::GTest once we upgrade the minimum CMake version required

14
unitTests/gtestwrapper.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef GTESTWRAPPER_H_
#define GTESTWRAPPER_H_
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4251)
#pragma warning(disable : 4275)
#endif
#include <gtest/gtest.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif // #ifndef GTESTWRAPPER_H_

View File

@ -1,4 +1,4 @@
#include <gtest/gtest.h>
#include "gtestwrapper.h"
#include <iostream>

View File

@ -1,6 +1,7 @@
#include <gtest/gtest.h>
#include <exiv2/types.hpp>
#include "gtestwrapper.h"
using namespace Exiv2;
// More info about tm : http://www.cplusplus.com/reference/ctime/tm/