From ae26ed1652535756560ea82e74403aacb032fd09 2018-12-03 20:26:15 From: Alexis Jeandet Date: 2018-12-03 20:26:15 Subject: [PATCH] Multi-graph test is ready, just need to implement synchronization Signed-off-by: Alexis Jeandet --- diff --git a/core b/core index 54e194b..79fb0ce 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 54e194b00c35fb5f769eda61234c1b4dd6de3a43 +Subproject commit 79fb0ced05d752f6e9260afddb38cc0d50e80c6d diff --git a/gui/tests/multiple_sync_graph/main.cpp b/gui/tests/multiple_sync_graph/main.cpp index b2ad723..0ad6ca2 100644 --- a/gui/tests/multiple_sync_graph/main.cpp +++ b/gui/tests/multiple_sync_graph/main.cpp @@ -19,7 +19,8 @@ template std::tuple< std::unique_ptr, std::vector>, - std::vector > + std::vector, + DateTimeRange> build_multi_graph_test() { auto w = std::make_unique(); @@ -39,8 +40,7 @@ build_multi_graph_test() graphs.push_back(graph); w->addGraph(graph); } - auto cent = center(w.get()); - return {std::move(w), variables, graphs}; + return {std::move(w), variables, graphs, range}; } @@ -52,34 +52,42 @@ public: private slots: void scrolls_left_with_mouse() { - auto [w, variables, graphs] = build_multi_graph_test<3>(); + auto [w, variables, graphs, range] = build_multi_graph_test<3>(); + auto var = variables.front(); + auto graph = graphs.front(); QVERIFY(prepare_gui_test(w.get())); + for (auto i = 0; i < 100; i++) { + scroll_graph(graph, -200); + waitForVar(var); + } + auto r = variables.back()->range(); /* * Scrolling to the left implies going back in time * Scroll only implies keeping the same delta T -> shit only transformation */ - //QVERIFY(r.m_TEnd < range.m_TEnd); - //QVERIFY(SciQLop::numeric::almost_equal(r.delta(),range.delta(),1)); + QVERIFY(r.m_TEnd < range.m_TEnd); + QVERIFY(SciQLop::numeric::almost_equal(r.delta(),range.delta(),1)); } void scrolls_right_with_mouse() { - auto [w, variables, graphs] = build_multi_graph_test<3>(); + auto [w, variables, graphs, range] = build_multi_graph_test<3>(); + auto var = variables.front(); + auto graph = graphs.front(); QVERIFY(prepare_gui_test(w.get())); -// w->show(); -// for(int i=0;i<10000;i++) -// { -// QThread::usleep(1000); -// qApp->processEvents(); -// } + for (auto i = 0; i < 100; i++) { + scroll_graph(graph, 200); + waitForVar(var); + } + auto r = variables.back()->range(); /* * Scrolling to the right implies going forward in time * Scroll only implies keeping the same delta T -> shit only transformation */ - //QVERIFY(r.m_TEnd > range.m_TEnd); - //QVERIFY(SciQLop::numeric::almost_equal(r.delta(),range.delta(),1)); + QVERIFY(r.m_TEnd > range.m_TEnd); + QVERIFY(SciQLop::numeric::almost_equal(r.delta(),range.delta(),1)); } }; diff --git a/gui/tests/simple_graph/main.cpp b/gui/tests/simple_graph/main.cpp index fd1d0b1..f478080 100644 --- a/gui/tests/simple_graph/main.cpp +++ b/gui/tests/simple_graph/main.cpp @@ -28,7 +28,6 @@ build_simple_graph_test() while (!isReady(var)) QCoreApplication::processEvents(); w->addVariable(var, range); while (!isReady(var)) QCoreApplication::processEvents(); - auto cent = center(w.get()); return {std::move(w), var, range}; }