diff options
| author | YongDo-Hyun <froster12@naver.com> | 2025-12-27 01:16:53 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-03-27 19:57:09 +0300 |
| commit | 7c9c42329e453c0c1e70ec37efcf5375065b3567 (patch) | |
| tree | 59e8567fc5cb9eec85abe19590119f9802b7b8db /test/format_test.cpp | |
| parent | df0519bea5390ac8f3d9a0e168e2f799bd068985 (diff) | |
| download | Project-Tick-7c9c42329e453c0c1e70ec37efcf5375065b3567.tar.gz Project-Tick-7c9c42329e453c0c1e70ec37efcf5375065b3567.zip | |
fix: prevent widening of stored tag type in value assignment; update test output handling
Signed-off-by: YongDo-Hyun <froster12@naver.com>
Diffstat (limited to 'test/format_test.cpp')
| -rw-r--r-- | test/format_test.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/format_test.cpp b/test/format_test.cpp index 1a689ed3f2..ed8d2d1bfc 100644 --- a/test/format_test.cpp +++ b/test/format_test.cpp @@ -87,15 +87,17 @@ int main() // Write to file and read back { + tag_compound file_comp = comp; + file_comp.erase("null"); std::ofstream out("test_output.nbt", std::ios::binary); - nbt::io::write_compound(out, comp); + nbt::io::write_tag("root", file_comp, out); } { std::ifstream in("test_output.nbt", std::ios::binary); - auto [read_comp, name] = nbt::io::read_compound(in); + auto read_pair = nbt::io::read_compound(in); std::cout << "----- read back from file:\n"; - std::cout << read_comp; + std::cout << *read_pair.second; std::cout << "\n-----" << std::endl; } |
