hello_world.cc 1.43 KB
// gtest
#include <gtest/gtest.h> // googletest header file

// collib
#include <collision_library.h>
using namespace collision;

// gmlib
#include <gmParametricsModule>
using namespace GMlib;

// stl
#include <memory>
#include <chrono>
#include <iostream>
using namespace std::chrono_literals;


TEST(MyUniqueTestCategory, MyCategory_UniqueTestName_WhichPasses) {

  EXPECT_TRUE(true);
}

TEST(MyUniqueTestCategory, MyCategory_UniqueTestName_WhichFails) {

  EXPECT_FALSE(true);
}

TEST(UniqueTest, DevelopmentTest) {

    Environment env;

    auto sphere1 = unittestDynamicPhysObjectFactory<GMlib::PSphere<float>>();
    sphere1->environment = &env;
    sphere1->translate(Vector<float,3>{1.0f,-3.0f,0.0f});
    sphere1->velocity = Vector<double, 3>{0.0, 2.1, 0.0};
    sphere1->curr_t_in_dt = seconds_type{0};

    auto sphere2 = unittestDynamicPhysObjectFactory<GMlib::PSphere<float>>();
    sphere2->environment = &env;
    sphere2->translate(Vector<float,3>{1.0f,3.0f,0.0f});
    sphere2->velocity = Vector<double, 3>{0.0, -2.1, 0.0};
    sphere2->curr_t_in_dt = seconds_type{0};

    const double dt {1.0};


    auto controller = unittestCollisionControllerFactory();
    controller->add(sphere1.get());
    controller->add(sphere2.get());

    Scene scene;
    scene.insert(controller.get());
    scene.prepare();

    scene.enabledFixedDt();
    scene.setFixedDt(dt);
    scene.start();
    scene.simulate();
    scene.prepare();

    EXPECT_FALSE(true);
}