mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Fixed hgt tile's grid traversal.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
#include "testing/testing.hpp"
|
||||
|
||||
#include "coding/internal/file_data.hpp"
|
||||
#include "coding/writer.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
|
||||
#include <cstring> // strlen
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace file_data_test
|
||||
{
|
||||
@@ -220,6 +217,35 @@ UNIT_TEST(EmptyFile)
|
||||
TEST(DeleteFileX(copy), ());
|
||||
}
|
||||
|
||||
UNIT_TEST(RenameOnExistingFile)
|
||||
{
|
||||
using namespace base;
|
||||
|
||||
std::string const name = "test.empty";
|
||||
std::string const copy = "test.empty.copy";
|
||||
{
|
||||
FileData f(name, FileData::Op::WRITE_TRUNCATE);
|
||||
uint8_t const x = 1;
|
||||
f.Write(&x, 1);
|
||||
}
|
||||
{
|
||||
FileData f(copy, FileData::Op::WRITE_TRUNCATE);
|
||||
uint8_t const x = 2;
|
||||
f.Write(&x, 1);
|
||||
}
|
||||
|
||||
TEST(RenameFileX(name, copy), ());
|
||||
|
||||
{
|
||||
FileData f(copy, FileData::Op::READ);
|
||||
uint8_t x;
|
||||
f.Read(0, &x, 1);
|
||||
TEST_EQUAL(x, 1, ());
|
||||
}
|
||||
|
||||
TEST(DeleteFileX(copy), ());
|
||||
}
|
||||
|
||||
// Made this 'obvious' test for getline. I had (or not?) behaviour when 'while (getline)' loop
|
||||
// didn't get last string in file without trailing '\n'.
|
||||
UNIT_TEST(File_StdGetLine)
|
||||
|
||||
Reference in New Issue
Block a user