Caffe2 - C++ API
A deep learning, cross platform ML framework
tempfile_test.cpp
1 #include <c10/util/tempfile.h>
2 #include <gtest/gtest.h>
3 
4 #if !defined(_WIN32)
5 TEST(TempFileTest, MatchesExpectedPattern) {
6  c10::TempFile pattern = c10::make_tempfile("test-pattern-");
7  ASSERT_NE(pattern.name.find("test-pattern-"), std::string::npos);
8 }
9 #endif // !defined(_WIN32)
TempFile make_tempfile(std::string name_prefix="torch-file-")
Like try_make_tempfile, but throws an exception if a temporary file could not be returned.
Definition: tempfile.h:97