File: RetransformTest.h

package info (click to toggle)
labplot 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,500 kB
  • sloc: cpp: 241,048; ansic: 6,324; python: 915; xml: 400; yacc: 237; sh: 221; awk: 35; makefile: 11
file content (85 lines) | stat: -rw-r--r-- 2,292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
	File                 : RetransformTest.h
	Project              : LabPlot
	Description          : Tests to evaluate retransforming
	--------------------------------------------------------------------
	SPDX-FileCopyrightText: 2021 Martin Marmsoler <martin.marmsoler@gmail.com>

	SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef RETRANSFORMTEST_H
#define RETRANSFORMTEST_H

#include "../../CommonMetaTest.h"

class RetransformTest : public CommonMetaTest {
	Q_OBJECT

	// Tests
private Q_SLOTS:
	void TestLoadProject();
	void TestLoadProject2();
	void TestResizeWindows();
	void TestPadding();
	void TestCopyPastePlot();
	void TestAddCurve();
	void TestImportCSV();
	void TestImportCSVInvalidateCurve();
	void TestSetScale();

	void TestZoomSelectionAutoscale();
	void TestZoomAutoscaleSingleYRange();
	void TestZoomAutoscaleSingleXRange();
	void TestZoom();

	void TestChangePlotRange();
	void TestChangePlotRangeElement();
	void TestChangePlotRangeElement2();
	void TestChangePlotRangeElement3();

	void TestBarPlotOrientation();

	void testPlotRecalcRetransform();
	void testPlotRecalcNoRetransform();

	void removeReaddxColum();
	void removeReaddyColum();

	void xyFunctionCurve();
};

/*!
 * \brief The RetransformCallCounter class
 * Used to count the retransform calls to evaluate that
 * the items retransform are called a exact number of times
 */
class RetransformCallCounter : public QObject {
	Q_OBJECT
public:
	QHash<QString, int> statistic(bool includeSuppressed);
	int elementLogCount(bool includeSuppressed);
	bool calledExact(int requiredCallCount, bool includeSuppressed);
	int callCount(const QString& path);
	int callCount(const AbstractAspect* aspect);
	void resetRetransformCount();
	void aspectRetransformed(const AbstractAspect* sender, bool suppressed);
	void retransformScaleCalled(const CartesianPlot* plot, CartesianCoordinateSystem::Dimension dim, int index);
	void aspectAdded(const AbstractAspect* aspect);

public:
	struct Retransformed {
		const AbstractAspect* aspect;
		bool suppressed;
	};

	struct ScaleRetransformed {
		const CartesianPlot* plot;
		int index;
	};
	QVector<Retransformed> logsRetransformed;
	QVector<ScaleRetransformed> logsXScaleRetransformed;
	QVector<ScaleRetransformed> logsYScaleRetransformed;
};

#endif // RETRANSFORMTEST_H