daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "gtest/gtest.h"
  2. #include "precision.hpp"
  3. using namespace std;
  4. TEST(PrecisionTest,PrecisionOpTest) {
  5.         PrecisionOp pre0 (3.14111,2);
  6.         EXPECT_EQ("3.14",pre0.stringify());
  7.         PrecisionOp pre1 (3.1459,2);
  8.         EXPECT_EQ("3.15",pre1.stringify());
  9.         PrecisionOp pre2 (6.66,4);
  10.         EXPECT_EQ("6.6600",pre2.stringify());
  11.         PrecisionOp pre3 (6,2);
  12.         EXPECT_EQ("6.00",pre3.stringify());
  13. }
  14. TEST(PrecisionTest,PrecisionRandTest) {
  15.         PrecisionRand preRan1(2);
  16.         EXPECT_EQ("86.00",preRan1.stringify());
  17.  
  18. }
  19.  
  20.  
  21.  
  22. int main(int argc, char **argv) {
  23.   ::testing::InitGoogleTest(&argc, argv);
  24.   return RUN_ALL_TESTS();
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top