DryChem
1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
testPotentiallyEmptyBaseClass.hpp
Go to the documentation of this file.
1
// Copyright (c) 2020-2025 Cody R. Drisko. All rights reserved.
2
// Licensed under the MIT License. See the LICENSE file in the project root for more information.
3
//
4
// Name: testPotentiallyEmptyBaseClass.hpp
5
// Author: crdrisko
6
// Date: 09/18/2020-09:02:30
7
// Description: Provides ~100% unit test coverage over the potentially empty base class utility
8
9
#ifndef DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_TESTOPERATORS_TESTPOTENTIALLYEMPTYBASECLASS_HPP
10
#define DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_TESTOPERATORS_TESTPOTENTIALLYEMPTYBASECLASS_HPP
11
12
#include <
common-utils/utilities.hpp
>
13
#include <gtest/gtest.h>
14
15
#include "
../details/operatorDetails.hpp
"
16
17
GTEST_TEST
(testPotentiallyEmptyBaseClass, anEmptyBaseClassHasANonZeroSize)
18
{
19
ASSERT_TRUE(
sizeof
(DryChem::PotentiallyEmptyBaseClass<bool>) > 0);
20
}
21
22
GTEST_TEST
(testPotentiallyEmptyBaseClass, ebcoCouldBeUsedToMinimizeTheSizeOfADerivedEmptyClass)
23
{
24
using
CppUtils::Operators::details::testing::EmptyDerived
;
25
26
ASSERT_TRUE(
sizeof
(DryChem::PotentiallyEmptyBaseClass<EmptyDerived>) <=
sizeof
(EmptyDerived));
27
29
// ASSERT_TRUE(sizeof(DryChem::PotentiallyEmptyBaseClass<EmptyDerived>) == sizeof(EmptyDerived));
30
}
31
32
#endif
CppUtils::Operators::details::testing::EmptyDerived
The EBCO and CRTP used together for an empty class.
Definition
operatorDetails.hpp:18
operatorDetails.hpp
GTEST_TEST
GTEST_TEST(testPotentiallyEmptyBaseClass, anEmptyBaseClassHasANonZeroSize)
Definition
testPotentiallyEmptyBaseClass.hpp:17
utilities.hpp
common-utilities
libs
utilities
tests
testOperators
testPotentiallyEmptyBaseClass.hpp
Generated on Thu Feb 13 2025 11:55:13 for DryChem by
1.13.2