15 #include <gtest/gtest.h> 18 #include "../../include/ecl/devices/detail/character_buffer.hpp" 19 #include "../../include/ecl/devices/ofile.hpp" 35 TEST(FilesTests,construct) {
39 OFile o_file1(
"odude.txt",
New);
41 o_file2.open(
"odude2.txt",
New);
49 OFile o_file1(
"odude.txt",
New);
51 o_file2.open(
"odude2.txt",
New);
53 n = o_file1.write(
"Heya Dude\n",10);
56 n = o_file2.write(
"Heya Dude\n",10);
59 std::string heya_dude(
"Heya Dude From Array\n");
61 std::copy(heya_dude.begin(), heya_dude.end(), buffer.
begin());
62 n = o_file2.write(buffer.
stencil(0,heya_dude.size()));
75 OFile o_file(
"odude.txt",
Append);
77 n = o_file.write(
"Appending Dude\n",15);
79 EXPECT_TRUE( o_file.flush());
83 OFile o_file1(
"odude2.txt",
Append);
84 EXPECT_TRUE( o_file1.open());
86 EXPECT_FALSE( o_file2.open());
93 int main(
int argc,
char **argv) {
95 testing::InitGoogleTest(&argc,argv);
96 return RUN_ALL_TESTS();
int main(int argc, char **argv)
Stencil< Array< Type, Size > > stencil(const unsigned int &start_index, const unsigned int &n) ecl_assert_throw_decl(StandardException)
TEST(FilesTests, construct)
Simple char string buffer class for use internally by the devices.
Opens a new object (deletes existing objects).
Appends to an existing object (opens if not existing).