test: Added graph view UI tests
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
|
||||
#define CONTROLS_TESTS
|
||||
|
||||
namespace image_export
|
||||
{
|
||||
struct Struct
|
||||
{
|
||||
static void foo() {};
|
||||
};
|
||||
|
||||
class Base
|
||||
{
|
||||
virtual void foo() = 0;
|
||||
};
|
||||
|
||||
class Center
|
||||
: public Base
|
||||
{
|
||||
public:
|
||||
void foo() // <- ACTION: activate foo()
|
||||
{
|
||||
Struct s;
|
||||
Struct::foo();
|
||||
member = 2;
|
||||
}
|
||||
protected:
|
||||
int member;
|
||||
};
|
||||
|
||||
class Derived
|
||||
: public Center
|
||||
{
|
||||
void foo() {}
|
||||
};
|
||||
|
||||
void bar()
|
||||
{
|
||||
Center c;
|
||||
c.foo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TEST: move - drag
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Click into graph void and drag
|
||||
// RESULT: graph is moved
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: move - WASD
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Use WASD to scroll up, down, left, right
|
||||
// RESULT: graph is moved
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: zoom - buttons
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION : Use screen zoom buttons bottom left
|
||||
// RESULT: Zoom Level changes, percentage in lower left corner
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: zoom - mouse wheel
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Hold Ctrl/Cmd and scroll in the graph
|
||||
// RESULT: Zoom Level changes, percentage in lower left corner
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: zoom - Shift + WS
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Hold Shift and press W/S
|
||||
// RESULT: Zoom Level changes, percentage in lower left corner
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: zoom reset
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Press button '0'
|
||||
// RESULT: Zoom level is reset
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: image export
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Export graph in every image format
|
||||
// RESULT: compare to images in "results/controls_tests"
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: legend
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: click '?' in lower right corner
|
||||
// RESULT 1: graph legend is displayed
|
||||
|
||||
// ACTION 2: click on any node
|
||||
// RESULT 2: nothing happens
|
||||
|
||||
// ACTION 3: go back and click any node
|
||||
// RESULT 3: node is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
@@ -0,0 +1 @@
|
||||
#include "level_1_file_1.h"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "level_2_file_1.h"
|
||||
#include "level_1_file_1.h"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "level_3_file_1.h"
|
||||
#include "level_2_file_1.h"
|
||||
@@ -0,0 +1 @@
|
||||
#include "level_2_file_1.h"
|
||||
@@ -0,0 +1,2 @@
|
||||
#include "level_4_file_1.h"
|
||||
#include "level_4_file_2.h"
|
||||
@@ -0,0 +1,193 @@
|
||||
|
||||
#define DEPTH_GRAPH_TESTS
|
||||
|
||||
|
||||
// TEST: callee graph
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
void level_4_func_1() {};
|
||||
void level_4_func_2() {};
|
||||
void level_4_func_3() {};
|
||||
void level_4_func_4() {};
|
||||
|
||||
void level_3_func_1() { level_4_func_1(); level_4_func_2(); };
|
||||
void level_3_func_2() { level_4_func_1(); level_4_func_2(); level_4_func_3(); };
|
||||
void level_3_func_3() { level_4_func_2(); level_4_func_3(); level_4_func_4(); };
|
||||
void level_3_func_4() { level_4_func_3(); level_4_func_4(); };
|
||||
|
||||
void level_2_func_1() { level_3_func_1(); level_3_func_2(); };
|
||||
void level_2_func_2() { level_3_func_3(); level_3_func_4(); };
|
||||
|
||||
void level_1_func_1() // <- ACTION 1: activate
|
||||
{
|
||||
level_2_func_1();
|
||||
level_2_func_2();
|
||||
};
|
||||
|
||||
// ACTION 2: Show callee graph '<'
|
||||
// RESULTS 2:
|
||||
// - horizontal layout using bezier curve edges
|
||||
// - nodes from level 1 to 4 displayed
|
||||
|
||||
// ACTION 3: hover and click edges
|
||||
// RESULTS 3:
|
||||
// - hover highlight in grey
|
||||
// - click shows source location in code
|
||||
|
||||
// ACTION 4: Reduce graph depth to 2
|
||||
// RESULTS 4:
|
||||
// - only nodes up to level 3 displayed
|
||||
|
||||
// ACTION 5: Click on any node
|
||||
// RESULT 5: node is activated as usual
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: caller graph with template and override
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
void level_3_func_5()
|
||||
{
|
||||
level_4_func_4(); // <- ACTION 1: activate
|
||||
}
|
||||
|
||||
class Level1
|
||||
{
|
||||
public:
|
||||
virtual void func() = 0;
|
||||
};
|
||||
|
||||
class Level2
|
||||
: public Level1
|
||||
{
|
||||
public:
|
||||
void func() override { level_3_func_5(); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Level2_Template
|
||||
{
|
||||
public:
|
||||
void func() {
|
||||
level_3_func_5();
|
||||
}
|
||||
};
|
||||
|
||||
void level_0_func1()
|
||||
{
|
||||
Level1* level;
|
||||
level->func();
|
||||
|
||||
Level2_Template<int> levelTemplate;
|
||||
levelTemplate.func();
|
||||
}
|
||||
|
||||
// ACTION 2: Increase graph depth above 10
|
||||
// ACTION 3: Show caller graph '>'
|
||||
// RESULTS 3:
|
||||
// - horizontal layout using bezier curve edges
|
||||
// - nodes from level 0 to 4 displayed
|
||||
// - layout contains override edge shown horizontally
|
||||
// - layout contains eplicit template class (dead end)
|
||||
// - layout contains implicit template class
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: inheritance graph
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
class Level_1_Class_1 {}; // <- ACTION 1: activate
|
||||
|
||||
class Level_2_Class_1 : public Level_1_Class_1 {};
|
||||
class Level_2_Class_2 : public Level_1_Class_1 {};
|
||||
|
||||
template <typename T>
|
||||
class Level_3_Class_1 : public Level_2_Class_1 {};
|
||||
|
||||
class Level_3_Class_2 : public Level_2_Class_1 {};
|
||||
class Level_3_Class_3 : public Level_2_Class_1 {};
|
||||
class Level_3_Class_4 : public Level_2_Class_1 {};
|
||||
|
||||
class Level_4_Class_2
|
||||
: public Level_3_Class_2
|
||||
, public Level_3_Class_3
|
||||
, public Level_3_Class_4
|
||||
{};
|
||||
|
||||
class Level_3_Class_5 : public Level_2_Class_2 {};
|
||||
class Level_3_Class_6 : public Level_2_Class_2 {};
|
||||
|
||||
class Level_4_Class_1 // <- ACTION 5: activate
|
||||
: public Level_3_Class_5
|
||||
, public Level_3_Class_6
|
||||
{};
|
||||
|
||||
void level_5_func()
|
||||
{
|
||||
Level_3_Class_1<int> a;
|
||||
Level_3_Class_1<char> b;
|
||||
Level_3_Class_1<bool> c;
|
||||
}
|
||||
|
||||
// ACTION 2: Show derived graph '^'
|
||||
// RESULTS 2:
|
||||
// - vertical layout using bezier curve edges
|
||||
// - nodes from level 1 to 4 displayed
|
||||
// - layout contains template specialization
|
||||
// - there are 2 framed groups in the graph
|
||||
|
||||
// ACTION 3: click on one framed group
|
||||
// ACTION 4: click on an edge connected to a framed group
|
||||
// RESULT 3 & 4: The groups are split
|
||||
|
||||
// ACTION 6: Show base graph 'v'
|
||||
// RESULTS 6: like before with other direction
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: pentagram graph
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
namespace pentagram
|
||||
{
|
||||
void func1(); // <- ACTION 1: activate
|
||||
void func2();
|
||||
void func3();
|
||||
void func4();
|
||||
void func5();
|
||||
|
||||
void func1() { func1(); func2(); func3(); func4(); func5(); }
|
||||
void func2() { func1(); func2(); func3(); func4(); func5(); }
|
||||
void func3() { func1(); func2(); func3(); func4(); func5(); }
|
||||
void func4() { func1(); func2(); func3(); func4(); func5(); }
|
||||
void func5() { func1(); func2(); func3(); func4(); func5(); }
|
||||
}
|
||||
|
||||
// ACTION 2: show caller and calle graph
|
||||
// RESULT 2: layout works without crash
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: include graph
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
#include "depth_files/level_5_file_1.h" // <- ACTION 1: activate
|
||||
|
||||
// ACTION 2: show includee graph '<'
|
||||
// RESULT 2: horizontal layout with bezier curve edges
|
||||
|
||||
#include "depth_files/level_1_file_1.h" // <- ACTION 3: activate
|
||||
|
||||
// ACTION 4: show includer graph '>'
|
||||
// RESULT 4: same
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
#define GROUPING_TESTS
|
||||
|
||||
// TEST: group by namespace
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
namespace alpha
|
||||
{
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
namespace beta
|
||||
{
|
||||
void foo() // <- ACTION 1: activate
|
||||
{
|
||||
alpha::foo();
|
||||
}
|
||||
}
|
||||
|
||||
namespace alpha
|
||||
{
|
||||
void bar() { beta::foo(); }
|
||||
}
|
||||
|
||||
// ACTION 2: toggle grouping by namespace on and off
|
||||
// RESULTS 2:
|
||||
// - layout changes between grouped not grouped
|
||||
// - grouped layout has 2 groups: alpha, beta
|
||||
// - ungrouped layout has 3 nodes
|
||||
|
||||
// ACTION 3: click on a group name
|
||||
// RESULT 3: namespace is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: group by file
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
#include "interaction_files/file.h"
|
||||
#include "interaction_files/include.h"
|
||||
|
||||
int multi_file_function() // <- ACTION 1: activate
|
||||
{
|
||||
File f;
|
||||
package::C p;
|
||||
Class c;
|
||||
c.member = 2;
|
||||
Enum e = ENUM_CONSTANT;
|
||||
}
|
||||
|
||||
// ACTION 2: toggle grouping by file on and off
|
||||
// RESULTS 2:
|
||||
// - layout changes between grouped not grouped
|
||||
// - grouped layout has 3 groups: grouping_test.cpp, file.h, include.h
|
||||
// - ungrouped layout has 5 nodes
|
||||
|
||||
// ACTION 3: click on a group name
|
||||
// RESULT 3: file is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
class File {};
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef __INCLUDE__
|
||||
#define __INCLUDE__
|
||||
|
||||
class Class
|
||||
{
|
||||
public:
|
||||
virtual void method();
|
||||
int member;
|
||||
};
|
||||
|
||||
struct Struct {};
|
||||
|
||||
enum Enum
|
||||
{
|
||||
ENUM_CONSTANT
|
||||
};
|
||||
|
||||
typedef int TypeDef;
|
||||
|
||||
namespace package
|
||||
{
|
||||
class C {};
|
||||
}
|
||||
|
||||
struct Str1 {};
|
||||
struct Str2 {};
|
||||
struct Str3 {};
|
||||
struct Str4 {};
|
||||
struct Str5 {};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,269 @@
|
||||
#include <map>
|
||||
#include "interaction_files/include.h"
|
||||
|
||||
#define INTERACTION_TESTS
|
||||
|
||||
|
||||
// TEST: hover nodes
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Activate legend and hover each node in the left column
|
||||
// RESULT: Each node changes on hover (except group node)
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: hover edge
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: Activate legend and hover each edge in the right column
|
||||
// RESULT: Each edge changes on hover
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: expand/collapse nodes
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
class CollapsedClass
|
||||
{
|
||||
void foo();
|
||||
void bar();
|
||||
};
|
||||
|
||||
class ExpandedClass
|
||||
{
|
||||
public:
|
||||
void method1();
|
||||
void method2();
|
||||
void method3();
|
||||
int member;
|
||||
|
||||
private:
|
||||
CollapsedClass field; // <- ACTION1: activate member;
|
||||
};
|
||||
|
||||
// RESULTS 1:
|
||||
// - ExpandedClass is half expanded (4)
|
||||
// - CollapsedClass is collapsed (2)
|
||||
|
||||
// ACTION 2: Expand CollapsedClass
|
||||
// RESULT 2: CollapsedClass is expanded (^)
|
||||
|
||||
// ACTION 3: Expand ExpandedClass
|
||||
// RESULT 3: ExpandedClass is expanded (^)
|
||||
|
||||
// ACTION 4: Collapse both classes with context menu action
|
||||
// RESULT 3: both clases are collapsed
|
||||
|
||||
// ACTION 5: Click on ExpandedClass
|
||||
// RESULT 5: ExpandedClass gets fully expanded
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: click node
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
namespace interaction
|
||||
{
|
||||
class User
|
||||
: public Class
|
||||
{
|
||||
void method() // <- ACTION 1: activate function
|
||||
{
|
||||
member = 1;
|
||||
Struct s;
|
||||
Enum e = ENUM_CONSTANT;
|
||||
TypeDef d;
|
||||
using namespace package;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ACTION 2: Click each node in the graph
|
||||
// RESULT 2: Each node is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: click namespace
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: repeat ACTION 1 above
|
||||
|
||||
// ACTION 2: hover triangle at 'User'
|
||||
// RESULT 2: namespace label 'interaction' appears
|
||||
|
||||
// ACTION 3: click 'interaction'
|
||||
// RESULT 3: namespace 'interaction' is active
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: click edge
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: repeat ACTION 1 above
|
||||
|
||||
// ACTION 2: click every edge in the graph, except inheritance
|
||||
// RESULTS 2:
|
||||
// - each edge is highlighted on click
|
||||
// - graph layout does not change
|
||||
|
||||
// ACTION 3: Click into graph void
|
||||
// RESULT 3: Edge is deactivated
|
||||
|
||||
// ACTION 4: click inheritance edge
|
||||
// RESULTS 4:
|
||||
// - graph layout changes
|
||||
// - graph shows base and derived class node
|
||||
// - inheritance edge is active
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: move nodes
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: repeat ACTION 1 above
|
||||
|
||||
// ACTION 2: click and drag node Class by clicking on "Class"
|
||||
// RESULTS 2:
|
||||
// - node is moveable
|
||||
// - on mouse release the node sticks to a grid
|
||||
|
||||
// ACTION 3: repeat ACTION 2 but click on "PUBLIC"
|
||||
// ACTION 4: repeat ACTION 2 but click on "method"
|
||||
|
||||
// ACTION 5: click and drag node Class far to the left
|
||||
// RESULTS 5:
|
||||
// - all connected edges keep pointing correctly
|
||||
// - the graph increases it's size to fit the full graph
|
||||
|
||||
// ACTION 6: repeat ACTION 5 to right
|
||||
// ACTION 7: repeat ACTION 5 to top
|
||||
// ACTION 8: repeat ACTION 5 to bottom
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: hide nodes and edges
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: repeat ACTION 1 above
|
||||
|
||||
// ACTION 2: hide node 'Struct::Struct()' (context menu action or shortcut)
|
||||
// RESULTS 2:
|
||||
// - 'Struct::Struct()' is hidden
|
||||
// - call edge to 'Struct::Struct()' is hidden
|
||||
|
||||
// ACTION 3: hide inheritance edge
|
||||
// RESULT 3: inheritance edge is hidden
|
||||
|
||||
// ACTION 4: hide node 'Class'
|
||||
// RESULTS 4:
|
||||
// - 'Class' and all members are hidden
|
||||
// - all edges to 'Class' are hidden
|
||||
|
||||
// ACTION 5: hide type use edge to 'TypeDef'
|
||||
// RESULTS 5:
|
||||
// - 'Typedef' is hidden
|
||||
// - type use edge is hidden
|
||||
|
||||
// ACTION 6: hide node 'User'
|
||||
// RESULT 6: nothing happens, error in status bar
|
||||
|
||||
// ACTION 7: hide node 'User::method()'
|
||||
// RESULT 7: nothing happens, error in status bar
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: bundle expand
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
namespace interaction
|
||||
{
|
||||
struct BundleBase // <- ACTION 1: activate node
|
||||
{
|
||||
void bundles()
|
||||
{
|
||||
Class c; Struct s; Enum e = ENUM_CONSTANT; TypeDef d;
|
||||
CollapsedClass c1; ExpandedClass e1; User u;
|
||||
Str1 st1; Str2 st2; Str3 st3; Str4 st4; Str5 st5;
|
||||
|
||||
e1.method1();
|
||||
e1.method2();
|
||||
e1.method3();
|
||||
e1.member;
|
||||
|
||||
std::map<int, int> m;
|
||||
for (auto it = m.begin(); it != m.end(); it++)
|
||||
m.find(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// RESULT 1: graph shows 2 bundles
|
||||
|
||||
// ACTION 2: Click on 'Non-Indexed Symbols'
|
||||
// RESULT 2: bundle is split
|
||||
|
||||
// ACTION 3: Click on edge going to 'Referenced Symbols'
|
||||
// RESULT 3: bundle is split
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: aggregation expand
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: Click on aggregation between 'BundleBase -> ExpandedClass'
|
||||
// RESULTS 1:
|
||||
// - graph shows 6 edges: 4 call, 1 use, 1 type use
|
||||
// - edges are displayed as bezier curves
|
||||
|
||||
// ACTION 2: Click on any edge
|
||||
// RESULT 2: Edge is activated and code shows it's location
|
||||
|
||||
// ACTION 3: Click into graph void
|
||||
// RESULT 3: Edge is deactivated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: copy name
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
void copy_this_name(); // <- ACTION 1: Activate function
|
||||
|
||||
// ACTION 2: Use context menu action 'Copy Name' and paste to text editor
|
||||
// RESULT 2: 'copy_this_name' is pasted
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: file node actions
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
#include "interaction_files/file.h" // <- ACTION 1: Activate file
|
||||
|
||||
// ACTION 2: Context menu action 'Copy Full Path' on file node, paste to editor
|
||||
// ACTION 2: Absolute file path is pasted
|
||||
|
||||
// ACTION 3: Context menu action 'Open Containing Folder' on file node
|
||||
// ACTION 3: File explorer shows parent directory of file
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
@@ -0,0 +1,209 @@
|
||||
|
||||
#define LAYOUT_TESTS
|
||||
|
||||
|
||||
// TEST: call layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
void right_function()
|
||||
{
|
||||
}
|
||||
|
||||
void middle_function() // <- ACTION 1: activate function
|
||||
{
|
||||
right_function();
|
||||
}
|
||||
|
||||
void left_function()
|
||||
{
|
||||
middle_function();
|
||||
}
|
||||
|
||||
// RESULT 1: layout correctly displayed horizontally: left -> middle -> right
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: inheritance layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
class Top {};
|
||||
|
||||
class Middle // <- ACTION 1: activate class
|
||||
: public Top
|
||||
{};
|
||||
|
||||
class Bottom
|
||||
: public Middle
|
||||
{};
|
||||
|
||||
// RESULT 1: layout correctly displayed vertically:
|
||||
// - Top
|
||||
// - Middle
|
||||
// - Bottom
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: override layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
class AbstractBase {
|
||||
protected:
|
||||
virtual void foo() = 0;
|
||||
virtual void bar() = 0;
|
||||
};
|
||||
|
||||
class Base : public AbstractBase {
|
||||
protected:
|
||||
void foo() override {} // <- ACTION 1: activate
|
||||
};
|
||||
|
||||
class Derived : public Base {
|
||||
protected:
|
||||
void bar() override // <- ACTION 2: activate
|
||||
{
|
||||
foo();
|
||||
}
|
||||
};
|
||||
|
||||
// RESULTS 1: layout correctly displayed vertically:
|
||||
// - AbstractBase
|
||||
// - Base
|
||||
// - Derived
|
||||
// override, call and inheritance edges visible
|
||||
|
||||
// RESULTS 2:
|
||||
// - AbstractBase is connected with dashed inheritance edge
|
||||
|
||||
// ACTION 3: Click on dashed inheritance edge
|
||||
// RESULT 3: inheritance chain is shown: AbstractBase -> Base -> Derived
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: enum layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
enum Category // <- ACTION 1: activate
|
||||
{
|
||||
ONE,
|
||||
TWO,
|
||||
THREE // <- ACTION 2: activate
|
||||
};
|
||||
|
||||
// RESULTS 1:
|
||||
// - enum shows all chilren
|
||||
// - enum is expandable/collapsable
|
||||
// - children layouted in nameless access frame
|
||||
|
||||
// RESULT 2: same as Action 1
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: function children layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
void foobar() // <- ACTION 1: activate
|
||||
{
|
||||
struct A {};
|
||||
struct B {}; // <- ACTION 2: activate
|
||||
}
|
||||
|
||||
// RESULTS 1:
|
||||
// - function shows all chilren
|
||||
// - function is not expandable/collapsable
|
||||
// - children layouted in nameless access frame
|
||||
|
||||
// RESULT 2: same as Action 1, but second struct is not visible
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: implicit classes
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
template<typename T>
|
||||
class BaseType // <- ACTION 1: activate
|
||||
{
|
||||
};
|
||||
|
||||
void implicit_type_creator() // <- ACTION 2: activate
|
||||
{
|
||||
BaseType<int> a;
|
||||
BaseType<bool> b;
|
||||
}
|
||||
|
||||
// RESULT 1: implicit classes shown in vertical layout
|
||||
|
||||
// RESULT 2: implicit classes shown as used types
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: implicit methods
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
class AnotherType // <- ACTION 1: activate
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
void foo(T t) {} // <- ACTION 2: activate
|
||||
};
|
||||
|
||||
void implicit_method_creator() // <- ACTION 3: activate
|
||||
{
|
||||
AnotherType a;
|
||||
a.foo(1);
|
||||
a.foo(true);
|
||||
}
|
||||
|
||||
// RESULT 1: class shows method, but not implicit methods
|
||||
|
||||
// RESULT 2: implicit methods appear
|
||||
|
||||
// RESULT 3: calls to implicit methods visible
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: namespace layout
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
namespace layout // <- ACTION: activate
|
||||
{
|
||||
int a;
|
||||
|
||||
class B;
|
||||
|
||||
typedef int C;
|
||||
}
|
||||
|
||||
// RESULTS:
|
||||
// - namespace displayed as group
|
||||
// - all contents displayed
|
||||
// - includes a letter index
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: file contents
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION: activate this file
|
||||
// RESULTS:
|
||||
// - file node contains all nodes defined in this file
|
||||
// - file node is expanded
|
||||
// - file node can be collapsed
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
#define OVERVIEW_TESTS
|
||||
|
||||
|
||||
// TEST: activate overview
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: click on overview button
|
||||
// RESULT 1: overview is activated
|
||||
|
||||
// ACTION 2: go back and use menu action "Edit -> To overview"
|
||||
// RESULT 2: overview is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: overview bundles
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: activate overview
|
||||
// RESULTS 1:
|
||||
// - overview shows 10 bundles
|
||||
// - Files, Macros, Namespaces, Classes, Structs, Unions, functions, global_variable, Typedefs, Enums
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: overview bundle split
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: activate overview
|
||||
// ACTION 2: Click on Classes bundle
|
||||
// RESULTS 2:
|
||||
// - all classes are displayed within a group frame
|
||||
// - the nodes are alphabetically sorted by starting letter
|
||||
// - the group frame does not react to clicks
|
||||
|
||||
// ACTION 3: Click on a class
|
||||
// RESULT 3: the class is activated
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// TEST: overview letter index
|
||||
// START ----------------------------------------------------------------------
|
||||
|
||||
// ACTION 1: activate overview
|
||||
// ACTION 2: Click on Union bundle
|
||||
// ACTION 3: Press letter keys on keyboard
|
||||
// RESULT 3: the graph is scrolled to the respective letter pressed
|
||||
|
||||
// END ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
union A_Union_Type_Name_Making_A_Long_List {};
|
||||
union B_Union_Type_Name_Making_A_Long_List {};
|
||||
union C_Union_Type_Name_Making_A_Long_List {};
|
||||
union D_Union_Type_Name_Making_A_Long_List {};
|
||||
union E_Union_Type_Name_Making_A_Long_List {};
|
||||
union F_Union_Type_Name_Making_A_Long_List {};
|
||||
union G_Union_Type_Name_Making_A_Long_List {};
|
||||
union H_Union_Type_Name_Making_A_Long_List {};
|
||||
union I_Union_Type_Name_Making_A_Long_List {};
|
||||
union J_Union_Type_Name_Making_A_Long_List {};
|
||||
union K_Union_Type_Name_Making_A_Long_List {};
|
||||
union L_Union_Type_Name_Making_A_Long_List {};
|
||||
union M_Union_Type_Name_Making_A_Long_List {};
|
||||
union N_Union_Type_Name_Making_A_Long_List {};
|
||||
union O_Union_Type_Name_Making_A_Long_List {};
|
||||
union P_Union_Type_Name_Making_A_Long_List {};
|
||||
union Q_Union_Type_Name_Making_A_Long_List {};
|
||||
union R_Union_Type_Name_Making_A_Long_List {};
|
||||
union S_Union_Type_Name_Making_A_Long_List {};
|
||||
union T_Union_Type_Name_Making_A_Long_List {};
|
||||
union U_Union_Type_Name_Making_A_Long_List {};
|
||||
union V_Union_Type_Name_Making_A_Long_List {};
|
||||
union W_Union_Type_Name_Making_A_Long_List {};
|
||||
union X_Union_Type_Name_Making_A_Long_List {};
|
||||
union Y_Union_Type_Name_Making_A_Long_List {};
|
||||
union Z_Union_Type_Name_Making_A_Long_List {};
|
||||
|
||||
int global_variable;
|
||||
Reference in New Issue
Block a user