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
13#include <gtest/gtest.h>
14
16
17GTEST_TEST(testPotentiallyEmptyBaseClass, anEmptyBaseClassHasANonZeroSize)
18{
19 ASSERT_TRUE(sizeof(DryChem::PotentiallyEmptyBaseClass<bool>) > 0);
20}
21
22GTEST_TEST(testPotentiallyEmptyBaseClass, ebcoCouldBeUsedToMinimizeTheSizeOfADerivedEmptyClass)
23{
25
26 ASSERT_TRUE(sizeof(DryChem::PotentiallyEmptyBaseClass<EmptyDerived>) <= sizeof(EmptyDerived));
27
29 // ASSERT_TRUE(sizeof(DryChem::PotentiallyEmptyBaseClass<EmptyDerived>) == sizeof(EmptyDerived));
30}
31
32#endif
The EBCO and CRTP used together for an empty class.
Definition operatorDetails.hpp:18
GTEST_TEST(testPotentiallyEmptyBaseClass, anEmptyBaseClassHasANonZeroSize)
Definition testPotentiallyEmptyBaseClass.hpp:17