From ed3cffbb5cfdc5be409b4e036477efd03d3f42c0 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Wed, 12 Dec 2012 19:39:34 +0100 Subject: [PATCH] fstream test: added test no. 3 --- tests/src/fstream.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.51.2