本文整理汇总了C++中SetUp函数的典型用法代码示例。如果您正苦于以下问题:C++ SetUp函数的具体用法?C++ SetUp怎么用?C++ SetUp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetUp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F(MindMapModelTest, sortChangeParent)
{
Mindmapmodel->createMindMap("Root");
Mindmapmodel->createNode("Node1");
Mindmapmodel->insertNodeChild(0, 1);
Mindmapmodel->createNode("Node2");
Mindmapmodel->insertNodeChild(1, 2);
Mindmapmodel->createNode("Node3");
Mindmapmodel->insertNodeSibling(1, 3);
ASSERT_FALSE(Mindmapmodel->sortChangeParent(Mindmapmodel->MindMap[1]->getNodeList(), FIRST_NODE, 3));
TearDown();
SetUp();
Mindmapmodel->createMindMap("Root");
Mindmapmodel->createNode("Node1");
Mindmapmodel->insertNodeChild(0, 1);
Mindmapmodel->createNode("Node2");
Mindmapmodel->insertNodeChild(1, 2);
Mindmapmodel->createNode("Node3");
Mindmapmodel->insertNodeSibling(1, 3);
ASSERT_TRUE(Mindmapmodel->sortChangeParent(Mindmapmodel->MindMap[1]->getNodeList(), FIRST_NODE, 2));
TearDown();
SetUp();
Mindmapmodel->createMindMap("Root");
Mindmapmodel->createNode("Node1");
Mindmapmodel->insertNodeChild(0, 1);
Mindmapmodel->createNode("Node2");
Mindmapmodel->insertNodeChild(1, 2);
Mindmapmodel->createNode("Node3");
Mindmapmodel->insertNodeChild(2, 3);
ASSERT_TRUE(Mindmapmodel->sortChangeParent(Mindmapmodel->MindMap[1]->getNodeList(), FIRST_NODE, 3));
}
示例2: SetUp
void SceneCamera::Update(){
if(inversed) {
SetUp(control[currentType]->GetUp() * -1);
//SetPosition(control[currentType]->GetPosition() * -1);
//SetDirection(control[currentType]->GetDirection() *-1 );
} else {
SetUp(control[currentType]->GetUp());
SetPosition(control[currentType]->GetPosition());
SetDirection(control[currentType]->GetDirection());
}
// cout << "[SCENECAMERA][Update] controltype " << (int)currentType << endl;
}
示例3: Run
/// @param iterations Number of iterations to gather data for.
/// @returns the number of nanoseconds the run took.
uint64_t Run(std::size_t iterations)
{
std::size_t iteration = iterations;
// Set up the testing fixture.
SetUp();
// Get the starting time.
Clock::TimePoint startTime, endTime;
startTime = Clock::Now();
// Run the test body for each iteration.
while (iteration--)
TestBody();
// Get the ending time.
endTime = Clock::Now();
// Tear down the testing fixture.
TearDown();
// Return the duration in nanoseconds.
return Clock::Duration(startTime, endTime);
}
示例4: SetSide
/*!
*
* @param lookAtVec
* @param upVec
*/
Camera::Camera(glm::vec3 positionVec, glm::vec3 lookAtVec, glm::vec3 upVec)
{
m_initPos = positionVec;
m_position = positionVec;
m_initLookAt = lookAtVec;
m_lookAt = lookAtVec;
m_initUp = upVec;
m_up = upVec;
m_lookVec = m_initLookAt - m_initPos;
m_initSide = glm::cross(m_lookVec, m_initUp);
m_side = glm::cross(m_lookVec, m_initUp);
SetSide(m_side);
SetUp(m_up);
SetLookAt(m_lookAt);
SetPosition(m_position);
m_fieldOfView = 60.0f;
m_width = Singleton<Context>::Instance()->GetWidth();
m_height = Singleton<Context>::Instance()->GetHeight();
m_aspect = static_cast<float>(m_width) / static_cast<float>(m_height);
m_nearPlane = 0.1f;
m_farPlane = 200.f;
m_viewMatrix = glm::lookAt(m_position, m_lookAt, m_up);
m_inverseViewMatrix = glm::inverse(m_viewMatrix);
m_projectionMatrix = glm::perspective(m_fieldOfView, m_aspect, m_nearPlane, m_farPlane);
m_isOrtho = false;
m_speed = 0.05;
}
示例5: TEST_F
TEST_F(nearest_neighbor_test, save_load) {
{
core::fv_converter::datum d;
d.string_values_.push_back(std::make_pair("k1", "val"));
nearest_neighbor_->set_row("1", d);
}
// save to a buffer
msgpack::sbuffer sbuf;
msgpack::packer<msgpack::sbuffer> packer(sbuf);
nearest_neighbor_->get_mixable_holder()->pack(packer);
// restart the driver
TearDown();
SetUp();
// unpack the buffer
msgpack::unpacked unpacked;
msgpack::unpack(&unpacked, sbuf.data(), sbuf.size());
nearest_neighbor_->get_mixable_holder()->unpack(unpacked.get());
std::vector<std::pair<std::string, float> > res
= nearest_neighbor_->similar_row("1", 1);
ASSERT_EQ(1u, res.size());
EXPECT_EQ("1", res[0].first);
}
示例6: main
int main()
{
printf("hello world\n");
if(SetUp() < 0)
{
TearDown();
return -1;
}
GetPortMappingNum();
//int i = 0;
//for(i=0; i<30; i++)
//{
// GetPortMappingByIndex(i);
//}
GetPortMapping(16738, "TCP");
GetPortMapping(16738, "UDP");
AddPortMapping(16738, 16738, "TCP", g_lanaddr);
AddPortMapping(16738, 16738, "UDP", g_lanaddr);
AddPortMapping(16738, 16738, "TCP", "192.168.1.120");
AddPortMapping(16738, 16738, "UDP", "192.168.1.120");
TearDown();
return 0;
}
示例7: TEST_F
/* This test creates and calls the ABL wall function edge algorithm
for a single-element hex8 mesh and evaluates the resulting rhs vector
for one of the faces against a pre-calculated value.
*/
TEST_F(ABLWallFunctionHex8ElementWithBCFields, abl_wall_function_edge_alg_rhs) {
const double z0 = 0.1;
const double Tref = 300.0;
const double gravity = 9.81;
const double rho_specified = 1.0;
const double utau_specified = 0.067118435077841;
const double up_specified = 0.15;
const double yp_specified = 0.25;
const double aMag = 0.25;
const double tolerance = 1.0e-6;
const int numDof = 3;
SetUp(rho_specified, utau_specified, up_specified, yp_specified);
double rhs_gold = -rho_specified*utau_specified*utau_specified*aMag;
HelperObjectsABLWallFunction helperObjs(bulk, numDof, &meta.universal_part(), z0, Tref, gravity);
helperObjs.computeGeomBoundAlg->execute();
// Edge alg test
helperObjs.elemABLWallFunctionSolverAlg->initialize_connectivity();
helperObjs.realm.create_edges();
helperObjs.edgeABLWallFunctionSolverAlg->execute();
unit_test_utils::TestLinearSystem *linsys = helperObjs.linsys;
EXPECT_NEAR(linsys->rhs_(0), rhs_gold, tolerance);
}
示例8: SetUp
void RattlerRemovalServiceTests::RemoveRattlers_ForMixedPacking_CorrectParticlesRemoved()
{
SetUp();
// The second particle is outside
const FLOAT_TYPE diameter = 1.0;
const SpatialVector c0 = {{4, 4, 0}};
const SpatialVector c1 = {{7, 7, 0}};
const SpatialVector c2 = {{5, 4, 0}};
const SpatialVector c3 = {{5, 5, 0}};
particles[0] = DomainParticle(0, diameter, c0);
particles[1] = DomainParticle(1, diameter, c1);
particles[2] = DomainParticle(2, diameter, c2);
particles[3] = DomainParticle(3, diameter, c3);
rattlerRemovalService->SetParticles(particles);
vector<bool> rattlerMask(particlesCount);
rattlerRemovalService->FillRattlerMask(0.999, &rattlerMask);
boost::array<bool, 4> expectedRattlerMask = {{false, true, false, false}};
Assert::AreVectorsEqual(expectedRattlerMask, rattlerMask, "RemoveRattlers_ForMixedPacking_CorrectParticlesRemoved");
TearDown();
}
示例9: SetUp
CBlockManager::CBlockManager()
{
BlockNum = 30;
for(int i = 0;i < BlockNum;++i)
m_Blocks[i].SetUp();
SetUp();
}
示例10: SetDown
void Button::MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
{
// inherited
Control::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
// process left down and up
if (fEnabled) switch (iButton)
{
case C4MC_Button_LeftDown:
// mark button as being down
SetDown();
// remember drag target
// no dragging movement will be done w/o drag component assigned
// but it should be remembered if the user leaves the button with the mouse down
// and then re-enters w/o having released the button
if (!rMouse.pDragElement) rMouse.pDragElement = this;
break;
case C4MC_Button_LeftUp:
// only if button was down... (might have dragged here)
if (fDown)
{
// it's now up :)
SetUp(true);
// process event
OnPress();
}
break;
};
}
示例11: SetUp
void ClosestPairProviderTests::RegisterPair_ForFourParticlesAndMovedParticleIsCloseToNonMoved_ThisPairIsReturned()
{
SetUp();
//Closest pair is 2-3 with distance 0.5
const FLOAT_TYPE diameter = 1.0;
const SpatialVector c0 = {{5, 5, 5}};
const SpatialVector c1 = {{5.5, 5, 5}};
const SpatialVector c2 = {{5, 8, 5}};
const SpatialVector c3 = {{5.5, 8, 5}};
particles[0] = DomainParticle(0, diameter, c0);
particles[1] = DomainParticle(1, diameter, c1);
particles[2] = DomainParticle(2, diameter, c2);
particles[3] = DomainParticle(3, diameter, c3);
closestPairProvider->SetParticles(particles);
closestPairProvider->StartMove(0);
particles[0].coordinates[Axis::Y] = 7.9;
closestPairProvider->EndMove();
ParticlePair actualPair = closestPairProvider->FindClosestPair();
ParticlePair expectedPair(0, 2, 0.1 * 0.1);
AssertPair(expectedPair, actualPair, "RegisterPair_ForFourParticlesAndMovedParticleIsCloseToNonMoved_ThisPairIsReturned");
TearDown();
}
示例12: JoystickFeature
JoystickFeature(const JOYSTICK_FEATURE& feature) :
m_name(feature.name ? feature.name : ""),
m_type(feature.type)
{
switch (m_type)
{
case JOYSTICK_FEATURE_TYPE_SCALAR:
SetPrimitive(feature.scalar.primitive);
break;
case JOYSTICK_FEATURE_TYPE_ANALOG_STICK:
SetUp(feature.analog_stick.up);
SetDown(feature.analog_stick.down);
SetRight(feature.analog_stick.right);
SetLeft(feature.analog_stick.left);
break;
case JOYSTICK_FEATURE_TYPE_ACCELEROMETER:
SetPositiveX(feature.accelerometer.positive_x);
SetPositiveY(feature.accelerometer.positive_y);
SetPositiveZ(feature.accelerometer.positive_z);
break;
case JOYSTICK_FEATURE_TYPE_MOTOR:
SetPrimitive(feature.motor.primitive);
break;
default:
break;
}
}
示例13: LOG
void Test::__run()
{
LOG("[ RUN ] %s.%s", name(), method());
SetUp();
TestContext &ctx = TestContext::getInstance();
ctx.setTest(name(), method());
StopWatch stopwatch;
stopwatch.start();
__test();
stopwatch.stop();
int ms = stopwatch.getTimeMillisecond();
passCount_ = ctx.successCount();
failCount_ = ctx.failCount();
if(fail() == 0)
{
LOG("[ OK ] %s.%s (%d ms)", name(), method(), ms);
}
else
{
LOG("[ FAILED ] %s.%s (%d ms)", name(), method(), ms);
}
TearDown();
}
示例14: Main
Int2 Main (void)
{
WindoW w;
GrouP g;
ButtoN b1, b2, b3, b4, b5;
XOSPtr xosp;
ProcessUpdatesFirst (FALSE);
xosp = SetUp ();
w = FixedWindow (-50, -33, -10, -10,
"Consign", CloseConsignParentProc);
g = HiddenGroup (w, 7, 0, NULL);
b1 = PushButton (g, " Input GI ", ReadGIProc);
b2 = PushButton (g, "Input FastA", ReadFileProc);
b3 = PushButton (g, " Parameters", ConsignParamProc);
b4 = PushButton (g, " Consign ", ConsignProc);
b5 = PushButton (g, " Finish ", EndProg);
SetObjectExtra (w, xosp, NULL);
SetObjectExtra (b1, xosp, NULL);
SetObjectExtra (b2, xosp, NULL);
SetObjectExtra (b3, xosp, NULL);
SetObjectExtra (b4, xosp, NULL);
SetObjectExtra (b5, xosp, NULL);
Show (w);
ProcessEvents ();
return 0;
}
示例15: SetUp
void AnimationEffectBurst::SetUp(float pOrbit, float pAnimTestShiftDist, float pAnimTestShiftDistSpeed, float pAnimTestShiftDistDecay,
float pAnimTestShiftZ, float pAnimTestShiftZSpeed, float pAnimTestShiftZSpeedAdd)
{
SetUp(pOrbit, pAnimTestShiftDist, pAnimTestShiftDistSpeed);
mPos.mZ = pAnimTestShiftZ;
mVel.mZ = pAnimTestShiftZSpeed;
}