-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store temporary files on mac/lnx in tmp locations (#220)
* store temporary files on mac/lnx in tmp locations * guess win azure Temp location
- Loading branch information
1 parent
d16e510
commit 387a5a0
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <spatialindex/SpatialIndex.h> | ||
#include <spatialindex/tools/Tools.h> | ||
|
||
using namespace SpatialIndex; | ||
using namespace std; | ||
|
||
/* | ||
* Test the TemporaryFile | ||
*/ | ||
int main(int /*argc*/, char** /*argv*/) { | ||
Tools::TemporaryFile temporaryFile; | ||
|
||
const std::string path = temporaryFile.getFileName(); | ||
|
||
#if defined ( _MSC_VER ) | ||
const std::string shouldContain = "Temp"; | ||
if (path.find(shouldContain) == std::string::npos) { | ||
cerr << "Test failed: TemporaryFile path " << path << " does not contain " << shouldContain << endl; | ||
return -1; | ||
} | ||
#else | ||
const std::string lnxShouldContain = "/tmp/spatialindex-"; | ||
const std::string macShouldContain = "/var/folders/"; | ||
if ( (path.find(lnxShouldContain) == std::string::npos) && | ||
(path.find(macShouldContain) == std::string::npos) ) | ||
{ | ||
cerr << "Test failed: TemporaryFile path " << path << " does not contain " << lnxShouldContain << " nor " << macShouldContain << endl; | ||
return -1; | ||
} | ||
#endif | ||
|
||
|
||
|
||
|
||
return 0; | ||
} |