torrent-file: Fixing bug in wireEncode that breaks the implicit digest of the data packet

Change-Id: I3cf0e79e819c9d8c915b9ef766e9346828b00e66
Refs: #3489
diff --git a/tests/unit-tests/torrent-file.t.cpp b/tests/unit-tests/torrent-file.t.cpp
index 90b9b6d..abd224a 100644
--- a/tests/unit-tests/torrent-file.t.cpp
+++ b/tests/unit-tests/torrent-file.t.cpp
@@ -146,6 +146,7 @@
                    {"/NTORRENT/linux15.01/file0/1A2B3C4D",
                    "/NTORRENT/linux15.01/file1/2A3B4C5E"});
 
+  file.finalize();
   KeyChain keyChain;
   keyChain.sign(file);
 
@@ -169,6 +170,7 @@
                    {"/NTORRENT/linux15.01/file0/1A2B3C4D",
                    "/NTORRENT/linux15.01/file1/2A3B4C5E"});
 
+  file.finalize();
   KeyChain keyChain;
   keyChain.sign(file);
 
@@ -190,6 +192,7 @@
                   "",
                   {});
 
+  file.finalize();
   KeyChain keyChain;
   keyChain.sign(file);
 
@@ -209,6 +212,7 @@
                   "/NTORRENT/linux15.01",
                   {});
 
+  file.finalize();
   KeyChain keyChain;
   keyChain.sign(file);
 
@@ -260,6 +264,7 @@
                    {"/NTORRENT/linux15.01/file0/1A2B3C4D",
                    "/NTORRENT/linux15.01/file1/2A3B4C5E"});
 
+  file.finalize();
   KeyChain keyChain;
   keyChain.sign(file);
   Block wire = file.wireEncode();
@@ -270,6 +275,7 @@
 
   file.insert("/NTORRENT/linux15.01/file3/AB34C5KA");
   file.insert("/NTORRENT/linux15.01/file4/CB24C3GB");
+  file.finalize();
   Block wire2 = file.wireEncode();
 
   file2.wireDecode(wire2);