Update UnitTestFileGenerator.h
parent
c740977594
commit
0142bc35f7
|
@ -54,15 +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 err = _mktemp_s(tmplate, std::strlen(tmplate));
|
auto pathtemplate = _mktemp(tmplate);
|
||||||
EXPECT_NE(tmplate, nullptr);
|
EXPECT_NE(pathtemplate, nullptr);
|
||||||
if(tmplate == nullptr)
|
if(pathtemplate == nullptr)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
FILE *fs = nullptr;
|
auto* fs = std::fopen(pathtemplate, "w+");
|
||||||
err = fopen_s(&fs, tmplate, "w+");
|
EXPECT_NE(fs, nullptr); return fs;
|
||||||
EXPECT_EQ(err, 0);
|
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
|
Loading…
Reference in New Issue