Skip to content

Commit

Permalink
Reorganise files and folders, cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Dumusc committed Jul 18, 2018
1 parent f16b8d0 commit f32c4f7
Show file tree
Hide file tree
Showing 161 changed files with 481 additions and 558 deletions.
2 changes: 1 addition & 1 deletion apps/Launcher/Launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#ifndef LAUNCHER_H
#define LAUNCHER_H

#include "tide/master/FileInfoHelper.h"
#include "tide/master/qml/FileInfoHelper.h"

#include <deflect/qt/QmlStreamer.h>

Expand Down
2 changes: 1 addition & 1 deletion apps/Launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "Launcher.h"

#include "tide/core/log.h"
#include "tide/core/utils/log.h"
#include "tide/master/localstreamer/CommandLineOptions.h"

int main(int argc, char** argv)
Expand Down
2 changes: 1 addition & 1 deletion apps/TideConverter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#include "tide/core/CommandLineParser.h"
#include "tide/core/configuration/Configuration.h"
#include "tide/core/configuration/ConfigurationWriter.h"
#include "tide/core/utils/CommandLineParser.h"

#include <QCoreApplication>

Expand Down
4 changes: 2 additions & 2 deletions apps/TideForker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#include "tide/core/CommandLineParser.h"
#include "tide/core/log.h"
#include "tide/core/network/MPIChannel.h"
#include "tide/core/utils/CommandLineParser.h"
#include "tide/core/utils/log.h"
#include "tide/master/localstreamer/ProcessForker.h"

class CommandLineHelper : public CommandLineParser
Expand Down
2 changes: 1 addition & 1 deletion apps/TideMaster/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#include "log.h"
#include "utils/log.h"

#include "CommandLineParameters.h"
#include "MasterApplication.h"
Expand Down
4 changes: 2 additions & 2 deletions apps/TideWall/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#include "CommandLineParser.h"
#include "WallApplication.h"
#include "WallConfiguration.h"
#include "log.h"
#include "network/MPIChannel.h"
#include "utils/CommandLineParser.h"
#include "utils/log.h"

#include <QThreadPool>

Expand Down
2 changes: 1 addition & 1 deletion apps/Webbrowser/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include "Webbrowser.h"

#include "log.h"
#include "tide/master/localstreamer/CommandLineOptions.h"
#include "utils/log.h"

int main(int argc, char** argv)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/Whiteboard/Whiteboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#ifndef WHITEBOARD_H
#define WHITEBOARD_H

#include "tide/master/FileInfoHelper.h"
#include "tide/master/qml/FileInfoHelper.h"

#include <QGuiApplication>
#include <deflect/qt/QmlStreamer.h>
Expand Down
2 changes: 1 addition & 1 deletion apps/Whiteboard/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include "Whiteboard.h"

#include "tide/core/log.h"
#include "tide/core/utils/log.h"
#include "tide/master/localstreamer/CommandLineOptions.h"

int main(int argc, char** argv)
Expand Down
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog {#changelog}

# Release 1.5 (git master)

* [261](https://github.com/BlueBrain/Tide/pull/261):
Tweak UI design and controls style.
* [260](https://github.com/BlueBrain/Tide/pull/260):
Add context menu to copy-paste selected contents from one session to another.
Fix a bug that caused the "Touch to prevent sleep" dialog appear even when no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#define BOOST_TEST_MODULE LoggingUtilityTest
#define BOOST_TEST_MODULE ActivityLoggerTest

#include <boost/test/unit_test.hpp>

#include "LoggingUtility.h"
#include "rest/serialization.h"
#include "scene/DisplayGroup.h"
#include "tools/ActivityLogger.h"
#include "json/serialization.h"
// include last
#include "json/templates.h"
Expand Down Expand Up @@ -104,13 +104,13 @@ struct Fixture
DisplayGroupPtr displayGroup{DisplayGroup::create(wallSize)};
WindowPtr window1 = makeDummyWindow();
WindowPtr window2 = makeDummyWindow();
LoggingUtility logger;
ActivityLogger logger;
};

BOOST_FIXTURE_TEST_CASE(testAccumulatedWindowCount, Fixture)
{
QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);

BOOST_CHECK_EQUAL(logger.getAccumulatedWindowCount(), 0);

Expand All @@ -124,9 +124,9 @@ BOOST_FIXTURE_TEST_CASE(testAccumulatedWindowCount, Fixture)
BOOST_FIXTURE_TEST_CASE(testWindowCount, Fixture)
{
QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);
QObject::connect(displayGroup.get(), &DisplayGroup::windowRemoved, &logger,
&LoggingUtility::logWindowRemoved);
&ActivityLogger::logWindowRemoved);
BOOST_CHECK_EQUAL(logger.getWindowCount(), 0);
displayGroup->add(window1);
BOOST_CHECK_EQUAL(logger.getWindowCount(), 1);
Expand All @@ -139,17 +139,17 @@ BOOST_FIXTURE_TEST_CASE(testWindowCountCannotGetBelow0, Fixture)
BOOST_CHECK_EQUAL(logger.getWindowCount(), 0);
displayGroup->add(window1);
QObject::connect(displayGroup.get(), &DisplayGroup::windowRemoved, &logger,
&LoggingUtility::logWindowRemoved);
&ActivityLogger::logWindowRemoved);
displayGroup->remove(window1);
BOOST_CHECK_EQUAL(logger.getWindowCount(), 0);
}

BOOST_FIXTURE_TEST_CASE(testWindowCountDoesNotIncludeHiddenWindows, Fixture)
{
QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);
QObject::connect(displayGroup.get(), &DisplayGroup::windowRemoved, &logger,
&LoggingUtility::logWindowRemoved);
&ActivityLogger::logWindowRemoved);

BOOST_REQUIRE_EQUAL(logger.getWindowCount(), 0);

Expand All @@ -176,7 +176,7 @@ BOOST_FIXTURE_TEST_CASE(testInteractionCounter, Fixture)
BOOST_CHECK_EQUAL(logger.getInteractionCount(), 0);

QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);

displayGroup->add(window1);
displayGroup->addFocusedWindow(window1);
Expand All @@ -188,7 +188,7 @@ BOOST_FIXTURE_TEST_CASE(testLastInteractionName, Fixture)
BOOST_CHECK_EQUAL(logger.getLastInteractionName(), "");

QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);

displayGroup->add(window1);
displayGroup->addFocusedWindow(window1);
Expand All @@ -198,7 +198,7 @@ BOOST_FIXTURE_TEST_CASE(testLastInteractionName, Fixture)
BOOST_FIXTURE_TEST_CASE(hideLauncher, Fixture)
{
QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);

displayGroup->add(window1);
BOOST_CHECK_EQUAL(logger.getWindowCount(), 1);
Expand All @@ -217,7 +217,7 @@ BOOST_FIXTURE_TEST_CASE(testJsonOutput, Fixture)
BOOST_CHECK_EQUAL(json::dump(logger), defaultJson);

QObject::connect(displayGroup.get(), &DisplayGroup::windowAdded, &logger,
&LoggingUtility::logWindowAdded);
&ActivityLogger::logWindowAdded);
displayGroup->add(window1);
displayGroup->add(window2);

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/core/BackgroundTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ BOOST_FIXTURE_TEST_CASE(testBinarySerialization, Fixture)
BOOST_REQUIRE(copy->getContent());
BOOST_CHECK_EQUAL(copy->getContent()->parent(), copy.get());
BOOST_CHECK_NE(background->getContent(), copy->getContent());
BOOST_CHECK_EQUAL(background->getContent()->getURI(),
copy->getContent()->getURI());
BOOST_CHECK_EQUAL(background->getContent()->getUri(),
copy->getContent()->getUri());
}

BOOST_FIXTURE_TEST_CASE(testJsonSerialization, Fixture)
Expand Down
16 changes: 8 additions & 8 deletions tests/cpp/core/ContentControllerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ BOOST_AUTO_TEST_CASE(factory_method)
auto controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<ContentController*>(controller.get()));

dummyContent.type = CONTENT_TYPE_PIXEL_STREAM;
dummyContent.type = ContentType::pixel_stream;
BOOST_CHECK_THROW(ContentController::create(window), std::bad_cast);
Window streamWin(ContentFactory::getPixelStreamContent("xyz", QSize()));
BOOST_CHECK_NO_THROW(controller = ContentController::create(streamWin));
BOOST_CHECK(dynamic_cast<PixelStreamController*>(controller.get()));

#if TIDE_ENABLE_WEBBROWSER_SUPPORT
dummyContent.type = CONTENT_TYPE_WEBBROWSER;
dummyContent.type = ContentType::webbrowser;
BOOST_CHECK_THROW(ContentController::create(window), std::bad_cast);
Window webWindow(
ContentFactory::getPixelStreamContent("abc", QSize(),
Expand All @@ -87,30 +87,30 @@ BOOST_AUTO_TEST_CASE(factory_method)
#endif

#if TIDE_ENABLE_PDF_SUPPORT
dummyContent.type = CONTENT_TYPE_PDF;
dummyContent.type = ContentType::pdf;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<PDFController*>(controller.get()));
#endif

#if TIDE_ENABLE_MOVIE_SUPPORT
dummyContent.type = CONTENT_TYPE_MOVIE;
dummyContent.type = ContentType::movie;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<MovieController*>(controller.get()));
#endif

dummyContent.type = CONTENT_TYPE_IMAGE_PYRAMID;
dummyContent.type = ContentType::image_pyramid;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<ZoomController*>(controller.get()));

dummyContent.type = CONTENT_TYPE_TEXTURE;
dummyContent.type = ContentType::texture;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<ZoomController*>(controller.get()));

dummyContent.type = CONTENT_TYPE_SVG;
dummyContent.type = ContentType::svg;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<ContentController*>(controller.get()));

dummyContent.type = CONTENT_TYPE_MOVIE;
dummyContent.type = ContentType::movie;
controller = ContentController::create(window);
BOOST_CHECK(dynamic_cast<ContentController*>(controller.get()));
}
4 changes: 2 additions & 2 deletions tests/cpp/core/DummyContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class DummyContent : public Content
setDimensions(dimensions);
}

CONTENT_TYPE getType() const final { return type; }
ContentType getType() const final { return type; }
bool readMetadata() final { return true; }
bool hasFixedAspectRatio() const final { return fixedAspectRatio; }
bool canBeZoomed() const final { return zoomable; }
int dummyParam_ = 0;
CONTENT_TYPE type = CONTENT_TYPE_ANY;
ContentType type = ContentType::invalid;
bool fixedAspectRatio = true;
bool zoomable = true;

Expand Down
22 changes: 11 additions & 11 deletions tests/cpp/core/MultiScreenControllerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@
#include <boost/test/unit_test.hpp>

#include "MockScreenController.h"
#include "MultiScreenController.h"
#include "hardware/MultiScreenController.h"

BOOST_AUTO_TEST_CASE(testUniformScreenStates)
{
std::vector<std::unique_ptr<ScreenController>> controllers;
controllers.emplace_back(new MockScreenController(ScreenState::UNDEF));
controllers.emplace_back(new MockScreenController(ScreenState::UNDEF));
controllers.emplace_back(new MockScreenController(ScreenState::undefined));
controllers.emplace_back(new MockScreenController(ScreenState::undefined));

MultiScreenController multiController(std::move(controllers));

BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::UNDEF);
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::undefined);

multiController.powerOn();

Expand All @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(testUniformScreenStates)
static_cast<MockScreenController&>(*controller).powerOnCalled);
}

BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::ON);
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::on);

multiController.powerOff();

Expand All @@ -71,25 +71,25 @@ BOOST_AUTO_TEST_CASE(testUniformScreenStates)
BOOST_CHECK(
static_cast<MockScreenController&>(*controller).powerOffCalled);
}
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::OFF);
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::off);
}

BOOST_AUTO_TEST_CASE(testDifferentScreenStates)
{
std::vector<std::unique_ptr<ScreenController>> controllers;
controllers.emplace_back(new MockScreenController(ScreenState::ON));
controllers.emplace_back(new MockScreenController(ScreenState::OFF));
controllers.emplace_back(new MockScreenController(ScreenState::on));
controllers.emplace_back(new MockScreenController(ScreenState::off));

MultiScreenController multiController(std::move(controllers));

multiController.getState();
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::UNDEF);
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::undefined);
}

BOOST_AUTO_TEST_CASE(testSignal)
{
std::vector<std::unique_ptr<ScreenController>> controllers;
controllers.emplace_back(new MockScreenController(ScreenState::ON));
controllers.emplace_back(new MockScreenController(ScreenState::on));
MultiScreenController multiController(std::move(controllers));

bool emitted = false;
Expand All @@ -107,6 +107,6 @@ BOOST_AUTO_TEST_CASE(testSignal)

emitted = false;
multiController.powerOn();
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::ON);
BOOST_CHECK_EQUAL(multiController.getState(), ScreenState::on);
BOOST_CHECK(emitted);
}
Loading

0 comments on commit f32c4f7

Please sign in to comment.