version 1.2, 2015/04/20 18:10:35
|
version 1.3, 2015/04/20 18:20:37
|
|
|
# include <sys/types.h> | # include <sys/types.h> |
#endif | #endif |
| |
#ifdef T |
#ifdef ZT |
#undef T |
#undef ZT |
#endif | #endif |
| |
using namespace std; | using namespace std; |
|
|
namespace ut | namespace ut |
{ | { |
| |
static FILE* Fopen(const char* path, const char* mode) |
static FILE* File_Open(const char* path, const char* mode) |
{ | { |
#if defined(_MSC_VER) | #if defined(_MSC_VER) |
FILE* fp; | FILE* fp; |
|
|
| |
bool readFileContent( const std::string& file, std::vector< unsigned char >& content ) | bool readFileContent( const std::string& file, std::vector< unsigned char >& content ) |
{ | { |
FILE* f = Fopen(file.c_str(), "r"); |
FILE* f = File_Open(file.c_str(), "r"); |
if ( !f ) | if ( !f ) |
return false; | return false; |
| |
|
|
if (content.empty()) | if (content.empty()) |
return false; | return false; |
| |
FILE* f = Fopen(file.c_str(), "w"); |
FILE* f = File_Open(file.c_str(), "w"); |
if ( !f ) | if ( !f ) |
return false; | return false; |
| |
|
|
return res; | return res; |
| |
UT_ASSERT_FAILED_MSG( string(string("file not found: ") + file).c_str() ); | UT_ASSERT_FAILED_MSG( string(string("file not found: ") + file).c_str() ); |
//return string(); |
return string(); |
} | } |
| |
| |