File: test.cpp

package info (click to toggle)
ondselsolver 0~2025.01.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,884 kB
  • sloc: cpp: 30,594; makefile: 6
file content (172 lines) | stat: -rw-r--r-- 5,962 bytes parent folder | download | duplicates (3)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#include "pch.h"
#include <CADSystem.h>
#include <ASMTAssembly.h>
#include <GESpMatParPvPrecise.h>
#include <MomentOfInertiaSolver.h>

using namespace MbD;

TEST(OndselSolver, TestName) {
	EXPECT_EQ(1, 1);
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runOndselSinglePendulum) {
	//testing::internal::CaptureStdout();
	auto cadSystem = std::make_shared<CADSystem>();
	cadSystem->runOndselSinglePendulum();
	//std::string output = testing::internal::GetCapturedStdout();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runPreDragBackhoe1) {
	auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe1.asmt");
	assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe1.log");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runPreDragBackhoe2) {
	auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe2.asmt");
	assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe2.log");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runPreDragBackhoe3) {
	auto assembly = ASMTAssembly::assemblyFromFile(std::string(TEST_DATA_PATH) + "/runPreDragBackhoe3.asmt");
	assembly->runDraggingLog(std::string(TEST_DATA_PATH) + "/draggingBackhoe3.log");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, pistonAllowZRotation) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/pistonAllowZRotation.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, RevRevJt) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevRevJt.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, RevCylJt) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/RevCylJt.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, CylSphJt) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/CylSphJt.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, SphSphJt) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/SphSphJt.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, Gears) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/Gears.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, anglejoint) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/anglejoint.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, constvel) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/constvel.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, rackscrew) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/rackscrew.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, planarbug) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/planarbug.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, cirpendu2) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/cirpendu2.asmt");	//Under constrained. Testing ICKine.
	EXPECT_TRUE(true);
}
TEST(OndselSolver, quasikine) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/quasikine.asmt");	//Under constrained. Testing ICKine.
	EXPECT_TRUE(true);
}
TEST(OndselSolver, piston) {
	ASMTAssembly::readWriteFile(std::string(TEST_DATA_PATH) + "/piston.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runSinglePendulumSuperSimplified) {
	ASMTAssembly::runSinglePendulumSuperSimplified();	//Mass is missing
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runSinglePendulumSuperSimplified2) {
	ASMTAssembly::runSinglePendulumSuperSimplified2();	//DOF has infinite acceleration due to zero mass and inertias
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runSinglePendulumSimplified) {
	ASMTAssembly::runSinglePendulumSimplified();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runSinglePendulum) {
	ASMTAssembly::runSinglePendulum();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, piston2) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/piston.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, 00backhoe) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/00backhoe.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, circular) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/circular.asmt");	//Needs checking
	EXPECT_TRUE(true);
}
TEST(OndselSolver, engine1) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/engine1.asmt");	//Needs checking
	EXPECT_TRUE(true);
}
TEST(OndselSolver, fourbar) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbar.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, fourbot) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/fourbot.asmt");	//Very large but works
	EXPECT_TRUE(true);
}
TEST(OndselSolver, wobpump) {
	ASMTAssembly::runFile(std::string(TEST_DATA_PATH) + "/wobpump.asmt");
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runOndselDoublePendulum) {
	auto cadSystem = std::make_shared<CADSystem>();
	cadSystem->runOndselDoublePendulum();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runOndselPiston) {
	auto cadSystem = std::make_shared<CADSystem>();
	cadSystem->runOndselPiston();		//For debugging
	EXPECT_TRUE(true);
}
TEST(OndselSolver, runPiston) {
	auto cadSystem = std::make_shared<CADSystem>();
	cadSystem->runPiston();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, GESpMatParPvPrecise) {
	GESpMatParPvPrecise::runSpMat();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, MomentOfInertiaSolver) {
	MomentOfInertiaSolver::example1();
	EXPECT_TRUE(true);
}
TEST(OndselSolver, sharedptrTest) {
	auto assm = ASMTAssembly::With();

	std::shared_ptr<ASMTAssembly> assm1 = assm;	//New shared_ptr to old object. Reference count incremented.
	assert(assm == assm1);
	assert(assm.get() == assm1.get());
	assert(&assm != &assm1);
	assert(assm->constantGravity == assm1->constantGravity);
	assert(&(assm->constantGravity) == &(assm1->constantGravity));

	auto assm2 = std::make_shared<ASMTAssembly>(*assm);	//New shared_ptr to new object. Member variables copy old member variables
	assert(assm != assm2);
	assert(assm.get() != assm2.get());
	assert(&assm != &assm2);
	assert(assm->constantGravity == assm2->constantGravity);	//constantGravity is same object pointed to
	assert(&(assm->constantGravity) != &(assm2->constantGravity)); //Different shared_ptrs of same reference counter
	EXPECT_TRUE(true);
}