Update style to (almost) conform to ndn-cxx style using clang-format
diff --git a/tests/unit-tests/fs-watcher-delay.t.cpp b/tests/unit-tests/fs-watcher-delay.t.cpp
index b647487..0ccd5cc 100644
--- a/tests/unit-tests/fs-watcher-delay.t.cpp
+++ b/tests/unit-tests/fs-watcher-delay.t.cpp
@@ -19,17 +19,17 @@
*/
#include "fs-watcher.h"
-#include <boost/make_shared.hpp>
+#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/make_shared.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <fstream>
-#include <set>
#include <QtGui>
+#include <fstream>
#include <iostream>
+#include <set>
using namespace std;
using namespace boost;
@@ -38,41 +38,42 @@
BOOST_AUTO_TEST_SUITE(TestFsWatcherDelay)
void
-onChange(const fs::path &file)
+onChange(const fs::path& file)
{
cerr << "onChange called" << endl;
}
void
-onDelete(const fs::path &file)
+onDelete(const fs::path& file)
{
cerr << "onDelete called" << endl;
}
-void run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
+void
+run(fs::path dir, FsWatcher::LocalFile_Change_Callback c, FsWatcher::LocalFile_Change_Callback d)
{
int x = 0;
- QCoreApplication app (x, 0);
- FsWatcher watcher (dir.string().c_str(), c, d);
+ QCoreApplication app(x, 0);
+ FsWatcher watcher(dir.string().c_str(), c, d);
app.exec();
sleep(100);
}
-void SlowWrite(fs::path & file)
+void
+SlowWrite(fs::path& file)
{
fs::ofstream off(file, std::ios::out);
- for (int i = 0; i < 10; i++){
- off << i << endl;
+ for (int i = 0; i < 10; i++) {
+ off << i << endl;
usleep(200000);
}
}
-BOOST_AUTO_TEST_CASE (TestFsWatcherDelay)
+BOOST_AUTO_TEST_CASE(TestFsWatcherDelay)
{
fs::path dir = fs::absolute(fs::path("TestFsWatcher"));
- if (fs::exists(dir))
- {
+ if (fs::exists(dir)) {
fs::remove_all(dir);
}
@@ -88,12 +89,10 @@
thread writeThread(SlowWrite, file);
-
usleep(10000000);
// cleanup
- if (fs::exists(dir))
- {
+ if (fs::exists(dir)) {
fs::remove_all(dir);
}