Advertisement
shchuko

GTEST_FIXTURE

Mar 17th, 2020
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <random>
  2. #include <chrono>
  3. #include <gtest/gtest.h>
  4. #include <CPoint3D.hpp>
  5.  
  6. namespace Geometry3D {
  7.     class CPoint3DUnitTests : public ::testing::Test {
  8.     private:
  9.         static constexpr double MAX_DOUBLE = 10000.0;
  10.         static constexpr double MIN_DOUBLE = -10000.0;
  11.  
  12.         std::mt19937* random_engine = nullprt;
  13.         std::uniform_real_distribution<double>* double_distribution = nullptr;
  14.  
  15.     public:
  16.         double getRandomDouble() {
  17.             return double_distribution(*random_engine);
  18.         }
  19.     protected:
  20.         void SetUp() {
  21.             random_engine = new std::mt19937(std::chrono::system_clock::now().time_since_epoch().count());
  22.             double_distribution = new std::uniform_real_distribution<double>(MIN_DOUBLE, MAX_DOUBLE);
  23.             // TODO
  24.         }
  25.  
  26.         void TearDown() {
  27.             delete random_engine;
  28.             delete double_distribution;
  29.         }
  30.     };
  31.  
  32.     TEST(CPoint3DUnitTests, getX) {
  33.         // TODO
  34.         // double x =
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement