From 6e3ca5d7e801cd79037cc0a3604d907e5997b47f Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Wed, 18 Sep 2019 12:43:21 -0600 Subject: [PATCH] Deleted old sample test file --- test/sample.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 test/sample.cpp diff --git a/test/sample.cpp b/test/sample.cpp deleted file mode 100644 index f543f243..00000000 --- a/test/sample.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// tests.cpp -#include -#include - -double squareRoot(const double a) -{ - double b = sqrt(a); - if (b != b) // nan check - { - return -1.0; - } - else - { - return sqrt(a); - } -} - -TEST(SquareRootTest, PositiveNos) -{ - ASSERT_EQ(6, squareRoot(36.0)); - ASSERT_EQ(18.0, squareRoot(324.0)); - ASSERT_EQ(25.4, squareRoot(645.16)); - ASSERT_EQ(0, squareRoot(0.0)); -} - -TEST(SquareRootTest, NegativeNos) -{ - ASSERT_EQ(-1.0, squareRoot(-15.0)); - ASSERT_EQ(-1.0, squareRoot(-0.2)); -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} \ No newline at end of file