#gtest

2025-05-30

Покрытие процедурного кода в ООП проекте юнит-тестами в C++

Legacy проекты на С++ зачастую являются многокомпонентными, когда продукт использует несколько библиотек, которые имеют различную архитектуру для работы с ними. Обычно это: библиотеки, поставляемые как ООП решение (Некоторые модули boost, SOCI как пример) библиотеки, реализованные в функциональном стиле (OpenGL через С API, POSIX как пример) Из-за этого в итоговом проекте появляются сущности, которые внутри реализованы через классы, но внутри методов класса идет обращение к обычным функциям. Некоторые библиотеки имеют специфичные функции, которые для своей работы требуют первоначальную инициализацию. Как пример: поиск подключенных устройств и получение на них ссылок для дальнейшей работы или функции, которые требуют инициализации большого количества памяти. Вследствие этого возникает вопрос - как лучше реализовать покрытие юнит-тестами специфичных объектов, которые внутри себя имеют функции, требующие специальных условий для своей работы?

habr.com/ru/companies/megafon/

#c++ #gtest #google_testing_framework #mocking #unittesting #unittests

Sean Eric Fagankithrup@wandering.shop
2024-07-18

Ok. I am very bad at unit tests. I would like to create some. This is on #macos; we use #cmake for the most part, and the #gtest suite for tests, but I'm ok if I can only make something for #xcode

One issue I don't understand is: in Swift, if I want to use a substitute class for a system one (specifically, NEAppProxyFlow and its subclasses)... how do I handle that? Do I provide my own module "NetworkExtension" for the unit tests? Or something else?

2024-06-25

We've been working toward deprecating GTest for our testing library in favor of our in-house JTest testing library. J3ML our 3D math library is the current target for rewriting our unit tests to utilize JTest.

#C++ #TestingLibrary #GTest #GameDev #UnitTesting

2023-12-30

I wrote about my first experiences with the #meson build system and with #GTest framework to test #C++ code.

In the while I also wrote a simple #logging library compatible with #MPI.

blog.movimento-centrale.it/pos

DragonFox Saphira - soon GPN :therian:littlefox@gotosocial-dev.svc.0x0a.network
2023-10-31

Anyone here a #googletest #gtest contributor and willing to take a look at my PR? Boosts very welcome :3

https://github.com/google/googletest/pull/4402

2023-04-18

Okay, so when using #gtest / #gmock / #googletest to write C++ unit tests for code that uses dependency injection, how the *hell* do go about mocking dependencies of a class under test without having to mock the dependency class' dependencies, and *those* class' dependencies, and so on until you've mocked every class in the dependency tree of the class under test?

"Interfaces" or "templates" are *not* valid answers, as they drive complexity into your non-test code purely to support testing!

2018-04-17

En train de découvrir le fonctionnement de la monnaie Ğ1 via @monnaielibreoccitanie

Je me suis inscrit sur ĞTest afin de me familiariser quelqu'un pour me certifier?

Inscrit sous Tigre-Bleu
voici ma clef publique: 8dDufS4JUkW1yEf753ibamHsLR5GJKF9NL6cGnMbiygW

#duniter #gtest #ğtest #cesium #sakia #basicincome

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst