diff --git a/tests/src/fstream.cpp b/tests/src/fstream.cpp index c141df1fd..940ed2be4 100644 --- a/tests/src/fstream.cpp +++ b/tests/src/fstream.cpp @@ -9,6 +9,7 @@ void printFile(const char* path); void test1(); void test2(); +void test3(); char text[8001] = ""; const char* file = "/tmp/__test123"; @@ -23,6 +24,7 @@ int main() test1(); test2(); + test3(); return 0; } @@ -49,6 +51,15 @@ void test2() printFile(file); } +void test3() +{ + std::ofstream of(file, std::ios_base::binary|std::ios_base::in|std::ios_base::out|std::ios_base::trunc); + of.write(text, strlen(text)); + of.close(); + + printFile(file); +} + void printFile(const char* path) { std::ifstream in;