Update UnitTestFileGenerator.h
parent
efc046752c
commit
ecd144b63e
|
@ -54,14 +54,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
inline FILE* MakeTmpFile(char* tmplate)
|
inline FILE* MakeTmpFile(char* tmplate)
|
||||||
{
|
{
|
||||||
auto pathtemplate = _mktemp(tmplate);
|
auto pathtemplate = _mktemp_s(tmplate, std::strlen(tmplate));
|
||||||
EXPECT_NE(pathtemplate, nullptr);
|
EXPECT_NE(pathtemplate, nullptr);
|
||||||
if(pathtemplate == nullptr)
|
if(pathtemplate == nullptr)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
auto* fs = std::fopen(pathtemplate, "w+");
|
FILE *fs = nullptr;
|
||||||
EXPECT_NE(fs, nullptr);
|
auto err = fopen_s(&fs, pathtemplate, "w+");
|
||||||
|
EXPECT_EQ(err, 0);
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
|
Loading…
Reference in New Issue