googletest Questions
3
Solved
I have the following output from a Google Test unit test:
UnitTests.cc:56: Failure
Value of: LineSegment2i(Vector2i(-10,0), Vector2i(-10,10)).toLine()
Actual: 24-byte object <00-00 00-00 00-00...
Gradus asked 3/3, 2013 at 21:17
3
Foreword
I know what UB is, so I'm not asking how to avoid it, but whether there's a way to make unit testing more resistent to it, even if it's a probabilistic approach, that just makes UB more li...
Enstatite asked 10/8, 2021 at 14:46
3
I am new to Google's test products and trying them out with some signal processing code. I am trying to assert that to floating point arrays are equal to within some bounds, using google mock as su...
Pelagias asked 27/2, 2015 at 15:17
1
Solved
I upgraded to the latest release of Google Test, and several of my tests no longer compiled. I've reduced it to this:
#include <gtest/gtest.h>
#include <algorithm>
#include <cctype&...
Jenisejenkel asked 23/7, 2021 at 14:21
2
How can I expect multiple failures in google test? I use this when testing that asserts happen in my code under test. Because these asserts are not fatal, multiple can happen.
The following testc...
Lat asked 4/6, 2014 at 12:24
1
When trying to mock a function with google test i still get a warning that I miss a "override"
MOCK_METHOD(bool, functionName, (), (const override));
The warning I get states
xxx.h:31:2...
Boulevard asked 1/7, 2021 at 10:57
1
I am trying to setup google test with visual studio 2019 and cmake.
This is my CMakeFileLists.txt content:
cmake_minimum_required(VERSION 3.0)
project(test_me)
# GTest
enable_testing()
find_pack...
Pleopod asked 9/6, 2019 at 0:31
5
Solved
I'm trying to get my first ever unit test with Google Test framework + Visual Studio 2013.However I'm hitting the below error and can't understand why.
1>------ Build started: Project: FirstGoog...
Orangy asked 15/8, 2014 at 18:43
2
Solved
I have a very simple C++ library (one header file, one .cpp file). I want to write unit tests for this project using the Google C++ Testing Framework.
Here is the directory structure:
~/project1
...
Grannias asked 5/5, 2011 at 15:37
2
Solved
I have a section of code that I would not like to run if it is being unit tested. I was hoping to find some #defined flag that is set by the gtest library that I can check. I couldn't find one that...
Monroe asked 20/5, 2011 at 21:37
2
Let GTEST_DIR be the environment variable storing the path to the googletest directory. (I cloned googletest-master from googletest's github repo.)
I cd'ed into $GTEST_DIR, did a mkdir build &...
Cockscomb asked 6/8, 2016 at 9:10
4
Solved
I want to test that in case of some fail no method will be called on a mock object, using google mock.
So the code would be something like:
auto mockObj = new MockObj;
EXPECT_NO_METHOD_CALL(mockObj...
Amygdala asked 27/12, 2011 at 19:1
3
Solved
I wanted to integrate ctest to a c++/c project. I use google tests to write unit tests.
Relevant part of my CMakeLists.txt looks like this:
...
####### CREATING EXE #######
add_executable(test_ex...
Fortunetelling asked 15/5, 2017 at 14:24
2
Solved
I want to do somethink like this:
TEST(MyTestFixture, printAfterExpectationFailure)
{
const string request("bring me tea");
const string&& response = sendRequestAndGetResponse(request);...
Arapaima asked 7/12, 2016 at 20:38
2
Solved
I have a basic question regarding Googletest in Eclipse.
I am using the test-runner plug in to run the Googletests.
But I need to specify a binary which runs my unit tests (of course that makes s...
Wormy asked 9/7, 2015 at 17:58
1
Solved
I am exploring TDD (Test Driven Development) to test the code that I am writing in C and C++.
I have chosen to use Google Test as the unit test framework.
I have chosen to use FFF as the mocking fr...
Soulless asked 19/1, 2021 at 15:44
4
Solved
I have a C++ project using CMake. The project is built on CentOS machine. I have configured CLion to build remotely from MacOS. I have unit tests for the project and I am trying to run them from CL...
Tambour asked 26/9, 2019 at 20:0
3
Solved
I am trying to use GoogleTest to test a simple function, but as I run make in my build folder, the compiler throws Undefined Reference error messages at me. I've referenced the gtest header file, s...
Representational asked 30/9, 2012 at 0:10
6
Solved
I use Google C++ Testing Framework for unit testing of my code.
I use Eclipse CDT with C++ Unit testing module for output analysis.
Previously I used CppUnit it has macros family CPPUNIT*_MESSAG...
Resolvable asked 10/5, 2013 at 22:28
2
Solved
I installed and integrated latest version of vcpkg:
e:\work\vcpkg>vcpkg version
Vcpkg package management program version 0.0.65-692a363701156f1bc319306fbde93fb6748325f6
See LICENSE.txt for lic...
Siamang asked 24/12, 2016 at 18:8
2
Solved
I'm learning to google test. I downloaded gtest, ran commands ./configure and make and ended with
$ sudo cp -a include/gtest /usr/include
$ sudo cp -a lib/.libs/* /usr/lib/
i got all this from h...
Tailband asked 7/10, 2014 at 8:56
4
Solved
I need to generate temp file for a test. It looks like I can't use mkstemp because I need the filename to have a specific suffix, but the rest of the filename I don't care. Is there a way in GTest ...
Otten asked 15/7, 2016 at 14:12
3
Solved
I'm trying to do some sleep inside .WillOnce before invoking FuncHelper. So I need something similar to the following:
EXPECT_CALL(*_mock, Func(_,_,_)).Times(1)
.WillOnce(DoAll(InvokeWithoutArgs(...
Plague asked 7/6, 2016 at 12:2
4
Similar issue here.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.6)
# Locate GTest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
# Add test cpp file
add...
Amadaamadas asked 18/6, 2014 at 22:15
4
I want to add a testcase for functionality not yet implemented and mark this test case as "it's ok that I fail".
Is there a way to do this?
EDIT:
I want the test to be executed and the framework ...
Mozza asked 26/12, 2013 at 13:45
© 2022 - 2024 — McMap. All rights reserved.