mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[test] Fixed tests compilation
This commit is contained in:
@@ -58,6 +58,7 @@ apps_src += $(addprefix apps/,\
|
||||
math_variable_box_empty_controller.cpp \
|
||||
shift_alpha_lock_view.cpp \
|
||||
suspend_timer.cpp \
|
||||
timer_manager.cpp \
|
||||
title_bar_view.cpp \
|
||||
)
|
||||
|
||||
@@ -117,6 +118,7 @@ apps_tests_src = $(app_calculation_test_src) $(app_code_test_src) $(app_graph_te
|
||||
apps_tests_src += $(addprefix apps/,\
|
||||
alternate_empty_nested_menu_controller.cpp \
|
||||
global_preferences.cpp \
|
||||
dummy_timer_manager.cpp \
|
||||
)
|
||||
|
||||
ifeq ($(THEME_REPO),local)
|
||||
|
||||
6
apps/dummy_timer_manager.cpp
Normal file
6
apps/dummy_timer_manager.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <escher/timer_manager.h>
|
||||
|
||||
// This is the dummy implementation used in tests
|
||||
|
||||
void TimerManager::AddTimer(Timer * timer) { }
|
||||
void TimerManager::RemoveTimer(Timer * timer) { }
|
||||
10
apps/timer_manager.cpp
Normal file
10
apps/timer_manager.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <escher/timer_manager.h>
|
||||
#include <apps/apps_container.h>
|
||||
|
||||
void TimerManager::AddTimer(Timer * timer) {
|
||||
AppsContainer::sharedAppsContainer()->addTimer(timer);
|
||||
}
|
||||
|
||||
void TimerManager::RemoveTimer(Timer * timer) {
|
||||
AppsContainer::sharedAppsContainer()->removeTimer(timer);
|
||||
}
|
||||
@@ -86,6 +86,7 @@
|
||||
#include <escher/table_view_data_source.h>
|
||||
#include <escher/tiled_view.h>
|
||||
#include <escher/timer.h>
|
||||
#include <escher/timer_manager.h>
|
||||
#include <escher/toolbox.h>
|
||||
#include <escher/toolbox_message_tree.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
13
escher/include/escher/timer_manager.h
Normal file
13
escher/include/escher/timer_manager.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef ESCHER_TIMER_MANAGER_H
|
||||
#define ESCHER_TIMER_MANAGER_H
|
||||
|
||||
#include <escher/timer.h>
|
||||
|
||||
class TimerManager {
|
||||
public:
|
||||
// We need this file to not create dependece between apps and escher.
|
||||
static void AddTimer(Timer * timer);
|
||||
static void RemoveTimer(Timer * timer);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,15 +1,16 @@
|
||||
#include <apps/apps_container.h>
|
||||
#include <escher/animation_timer.h>
|
||||
#include <escher/timer_manager.h>
|
||||
|
||||
|
||||
void AnimationTimer::setAnimated(Animated * animated) {
|
||||
m_animated = animated;
|
||||
AppsContainer::sharedAppsContainer()->addTimer(this);
|
||||
TimerManager::AddTimer(this);
|
||||
}
|
||||
|
||||
void AnimationTimer::removeAnimated(Animated * animated) {
|
||||
if (m_animated == animated || animated == nullptr) {
|
||||
m_animated = nullptr;
|
||||
AppsContainer::sharedAppsContainer()->removeTimer(this);
|
||||
TimerManager::RemoveTimer(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <escher/slideable_message_text_view.h>
|
||||
#include <apps/apps_container.h>
|
||||
|
||||
SlideableMessageTextView::SlideableMessageTextView(const KDFont * font, I18n::Message message, float horizontalAlignment, float verticalAlignment, KDColor textColor, KDColor backgroundColor) :
|
||||
MessageTextView(font, message, horizontalAlignment, verticalAlignment, textColor, backgroundColor),
|
||||
|
||||
@@ -457,7 +457,7 @@ void assert_additional_results_compute_to(const char * expression, const char *
|
||||
return;
|
||||
}
|
||||
I18n::Message unitMessage;
|
||||
const int numberOfResults = Unit::SetAdditionalExpressionsAndMessage(units, value, additional, maxNumberOfResults, reductionContext, unitMessage);
|
||||
const int numberOfResults = Unit::SetAdditionalExpressionsAndMessage(units, value, additional, maxNumberOfResults, reductionContext, &unitMessage);
|
||||
|
||||
quiz_assert(numberOfResults == length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user