Tatsuhiro Tsujikawa 9 år sedan
förälder
incheckning
8e07568a9e

+ 2 - 2
src/DHTGetPeersReplyMessage.cc

@@ -92,7 +92,7 @@ std::unique_ptr<Dict> DHTGetPeersReplyMessage::getResponse()
       auto compactlen = bittorrent::packcompact(
           compact.data(), (*i)->getIPAddress(), (*i)->getPort());
       auto cclen =
-        static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
+          static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
       if (clen >= 0 && compactlen == cclen) {
         last = std::copy_n((*i)->getID(), DHT_ID_LENGTH, last);
         last = std::copy_n(std::begin(compact), compactlen, last);
@@ -134,7 +134,7 @@ std::unique_ptr<Dict> DHTGetPeersReplyMessage::getResponse()
       auto compactlen = bittorrent::packcompact(
           compact.data(), (*i)->getIPAddress(), (*i)->getPort());
       auto cclen =
-        static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
+          static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
       if (clen > 0 && compactlen == cclen) {
         valuesList->append(String::g(compact.data(), compactlen));
       }

+ 2 - 2
src/LpdMessage.cc

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #include "LpdMessage.h"
 #include "Peer.h"
 

+ 2 - 2
src/LpdMessage.h

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #ifndef D_LPD_MESSAGE_H
 #define D_LPD_MESSAGE_H
 

+ 2 - 2
src/LpdMessageDispatcher.cc

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #include "LpdMessageDispatcher.h"
 #include "SocketCore.h"
 #include "A2STR.h"

+ 2 - 2
src/LpdMessageDispatcher.h

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #ifndef D_LPD_MESSAGE_DISPATCHER_H
 #define D_LPD_MESSAGE_DISPATCHER_H
 

+ 2 - 2
src/LpdMessageReceiver.cc

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #include "LpdMessageReceiver.h"
 #include "SocketCore.h"
 #include "Logger.h"

+ 2 - 2
src/LpdMessageReceiver.h

@@ -31,8 +31,8 @@
  * version.  If you delete this exception statement from all source
  * files in the program, then also delete it here.
  */
- /* copyright --> */
- 
+/* copyright --> */
+
 #ifndef D_LPD_MESSAGE_RECEIVER_H
 #define D_LPD_MESSAGE_RECEIVER_H
 

+ 2 - 2
src/OptionHandlerFactory.cc

@@ -1799,8 +1799,8 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
     handlers.push_back(op);
   }
   {
-    OptionHandler* op(new FloatNumberOptionHandler(PREF_SEED_TIME, TEXT_SEED_TIME,
-                                              NO_DEFAULT_VALUE, 0));
+    OptionHandler* op(new FloatNumberOptionHandler(
+        PREF_SEED_TIME, TEXT_SEED_TIME, NO_DEFAULT_VALUE, 0));
     op->addTag(TAG_BITTORRENT);
     op->setInitialOption(true);
     op->setChangeGlobalOption(true);

+ 1 - 2
src/RequestGroup.cc

@@ -793,8 +793,7 @@ void RequestGroup::tryAutoFileRenaming()
       // if slash == idx - 1 this means a form of "*/.*", so the file name
       // starts with a dot, has no extension otherwise, and therefore do not
       // extract an extension either
-      (slash == std::string::npos || slash < idx - 1)
-      ) {
+      (slash == std::string::npos || slash < idx - 1)) {
     ext = fn.substr(idx);
     fn = fn.substr(0, idx);
   }

+ 2 - 1
test/MockPeerStorage.h

@@ -39,7 +39,8 @@ public:
   }
 
   virtual std::shared_ptr<Peer>
-  addAndCheckoutPeer(const std::shared_ptr<Peer>& peer, cuid_t cuid) CXX11_OVERRIDE
+  addAndCheckoutPeer(const std::shared_ptr<Peer>& peer,
+                     cuid_t cuid) CXX11_OVERRIDE
   {
     unusedPeers.push_back(peer);
     return nullptr;

+ 10 - 7
test/RequestGroupTest.cc

@@ -60,7 +60,6 @@ void RequestGroupTest::testTryAutoFileRenaming()
   }
   catch (const Exception& ex) {
     CPPUNIT_ASSERT_EQUAL(error_code::FILE_ALREADY_EXISTS, ex.getErrorCode());
-
   }
 
   option_->put(PREF_AUTO_FILE_RENAMING, "true");
@@ -69,15 +68,18 @@ void RequestGroupTest::testTryAutoFileRenaming()
 
   ctx->getFirstFileEntry()->setPath("/tmp/myfile.txt");
   group.tryAutoFileRenaming();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile.1.txt"), group.getFirstFilePath());
+  CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile.1.txt"),
+                       group.getFirstFilePath());
 
   ctx->getFirstFileEntry()->setPath("/tmp.txt/myfile");
   group.tryAutoFileRenaming();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1"), group.getFirstFilePath());
+  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1"),
+                       group.getFirstFilePath());
 
   ctx->getFirstFileEntry()->setPath("/tmp.txt/myfile.txt");
   group.tryAutoFileRenaming();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1.txt"), group.getFirstFilePath());
+  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1.txt"),
+                       group.getFirstFilePath());
 
   ctx->getFirstFileEntry()->setPath(".bashrc");
   group.tryAutoFileRenaming();
@@ -89,12 +91,13 @@ void RequestGroupTest::testTryAutoFileRenaming()
 
   ctx->getFirstFileEntry()->setPath("/tmp.txt/.bashrc");
   group.tryAutoFileRenaming();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1"), group.getFirstFilePath());
+  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1"),
+                       group.getFirstFilePath());
 
   ctx->getFirstFileEntry()->setPath("/tmp.txt/.bashrc.txt");
   group.tryAutoFileRenaming();
-  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1.txt"), group.getFirstFilePath());
-
+  CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1.txt"),
+                       group.getFirstFilePath());
 }
 
 void RequestGroupTest::testCreateDownloadResult()