|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2020-08-19
|
|
|
- * Changed: 2020-08-22
|
|
|
+ * Changed: 2020-08-25
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -34,7 +34,7 @@ namespace {
|
|
|
TEST_F(StorableFileTest, load)
|
|
|
{
|
|
|
ls_std::StorableFile storableFile {this->fileLocation};
|
|
|
- std::string content = {storableFile.load(), (size_t) storableFile.getFile()->getSize()};
|
|
|
+ ls_std::byte_field content = storableFile.load();
|
|
|
|
|
|
std::string expectedUnix = "Hello!" + ls_std::NewLine::getUnixNewLine();
|
|
|
std::string expectedWindows = "Hello!" + ls_std::NewLine::getWindowsNewLine();
|
|
@@ -45,7 +45,7 @@ namespace {
|
|
|
TEST_F(StorableFileTest, reset)
|
|
|
{
|
|
|
ls_std::StorableFile storableFile {this->fileLocation};
|
|
|
- std::string content = {storableFile.load(), (size_t) storableFile.getFile()->getSize()};
|
|
|
+ ls_std::byte_field content = storableFile.load();
|
|
|
|
|
|
std::string expectedUnix = "Hello!" + ls_std::NewLine::getUnixNewLine();
|
|
|
std::string expectedWindows = "Hello!" + ls_std::NewLine::getWindowsNewLine();
|
|
@@ -56,7 +56,7 @@ namespace {
|
|
|
|
|
|
std::string anotherFileLocation = TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
|
|
|
storableFile.reset(anotherFileLocation);
|
|
|
- content = {storableFile.load(), (size_t) storableFile.getFile()->getSize()};
|
|
|
+ content = storableFile.load();
|
|
|
|
|
|
expectedUnix = "nothing to say!" + ls_std::NewLine::getUnixNewLine();
|
|
|
expectedWindows = "nothing to say!" + ls_std::NewLine::getWindowsNewLine();
|
|
@@ -71,11 +71,11 @@ namespace {
|
|
|
file.createNewFile();
|
|
|
|
|
|
ls_std::StorableFile storableFile {path};
|
|
|
- std::string textUnix = "Testing save method!" + ls_std::NewLine::getUnixNewLine();
|
|
|
- std::string textWindows = "Testing save method!" + ls_std::NewLine::getWindowsNewLine();
|
|
|
+ ls_std::byte_field textUnix = "Testing save method!" + ls_std::NewLine::getUnixNewLine();
|
|
|
+ ls_std::byte_field textWindows = "Testing save method!" + ls_std::NewLine::getWindowsNewLine();
|
|
|
|
|
|
- storableFile.save((char*) textUnix.c_str());
|
|
|
- std::string content = storableFile.load();
|
|
|
+ storableFile.save(textUnix);
|
|
|
+ ls_std::byte_field content = storableFile.load();
|
|
|
ASSERT_TRUE(content == textUnix || content == textWindows);
|
|
|
|
|
|
file.remove();
|