Fixed getTempDir.

This commit is contained in:
Branimir Karadžić
2017-01-17 12:03:38 -08:00
parent a5f247b783
commit fb2daf7d9d
2 changed files with 15 additions and 3 deletions

View File

@@ -333,6 +333,15 @@ namespace bx
}
}
FileInfo fi;
if (stat("/tmp", fi)
&& FileInfo::Directory == fi.m_type)
{
strlncpy(_out, *_inOutSize, "/tmp");
*_inOutSize = 4;
return true;
}
return false;
#endif // BX_PLATFORM_*
}

View File

@@ -1,12 +1,15 @@
#include "test.h"
#include <bx/os.h>
TEST(getProcessMemoryUsed)
TEST_CASE("getProcessMemoryUsed", "")
{
CHECK(0 != bx::getProcessMemoryUsed() );
REQUIRE(0 != bx::getProcessMemoryUsed() );
// DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
}
TEST_CASE("getTempPath", "")
{
char tmpDir[512];
uint32_t len = BX_COUNTOF(tmpDir);
CHECK(bx::getTempPath(tmpDir, &len) );
REQUIRE(bx::getTempPath(tmpDir, &len) );
}