Skip to content
Snippets Groups Projects
Select Git revision
  • c5b982483ba843eac55610286251cfa6fb32ca4a
  • master default protected
  • refactoring
  • push_test
  • qpong_opengl
  • push_to_gitlab
  • feature_imgui_opengl
  • feature_google_test_integration
  • feature_config
  • merge_ci_and_googletest
  • feature_pixbuf
  • feature_heapBuffer
12 results

test_qpong.cpp

Blame
  • Armin Co's avatar
    Armin Co authored
    c5b98248
    History
    test_qpong.cpp 939 B
    #include <iostream>
    #include "gtest/gtest.h"
    
    #include "ImageBuffer.hpp"
    
    
    /// @brief Creating a test fixture frequently used objects for tests
    ///
    class QPongLib : public testing::Test
    {
        protected:
        ImageBuffer *momentumImage;
        ImageBuffer *positionImage;
        // members
    
        // called before any test
        void SetUp() override
        {
    
        }
    
        virtual void TearDown()
        {
    
        }
    
    };
    
    /// @brief A simple function to test
    ///
    int addInts(int a, int b)
    {
        return a + b;
    }
    
    
    TEST(ImageBuffer, getValue)
    {
        const ImageBuffer imbf;
        const ImageBuffer imbff;
        const ImageBuffer imbfff;
        
    }
    
    
    TEST(addInts, positiveValues)
    {
        int a {1};
        int b {3};
    
        ASSERT_EQ(addInts(a, b), 4);
    }
    
    TEST(addInts, shouldBreak)
    {
        EXPECT_NE(3+1, 0) << "Yes yes, because it is just a test!";
    }
    
    TEST(addInts, negativeValues)
    {
        ASSERT_EQ(-3 + -5, -8);
    }
    
    /// @todo Example for mocks and an explanation what they are.
    ///