DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
testingDetails.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: testingDetails.hpp
5// Author: crdrisko
6// Date: 11/15/2020-11:11:33
7// Description: Details to be used with the testing of the testing portion of the utilities library
8
9#ifndef DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_DETAILS_TESTINGDETAILS_HPP
10#define DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_DETAILS_TESTINGDETAILS_HPP
11
12#include <cstddef>
13
15{
17 {
18 unsigned long long operator()(unsigned long long iter) const
19 {
20 unsigned long long result {};
21
22 for (unsigned long long i {}; i < iter; ++i)
23 result += i * i;
24
25 return result;
26 }
27 };
28
29 class MyClass
30 {
31 private:
32 unsigned long long iter {};
33
34 public:
35 explicit MyClass(unsigned long long Iter) : iter {Iter} {}
36
37 unsigned long long sumSquares() const
38 {
39 unsigned long long result {};
40
41 for (unsigned long long i {}; i < iter; ++i)
42 result += i * i;
43
44 return result;
45 }
46 };
47
48 unsigned long long sumSquares(unsigned long long iter)
49 {
50 unsigned long long result {};
51
52 for (unsigned long long i {}; i < iter; ++i)
53 result += i * i;
54
55 return result;
56 }
57
58 void voidSumSquares(unsigned long long iter)
59 {
60 unsigned long long result {};
61
62 for (unsigned long long i {}; i < iter; ++i)
63 result += i * i;
64
65 std::cout << result << '\n';
66 }
67} // namespace CppUtils::Testing::details::testing
68
69#endif
unsigned long long iter
Definition testingDetails.hpp:32
MyClass(unsigned long long Iter)
Definition testingDetails.hpp:35
unsigned long long sumSquares() const
Definition testingDetails.hpp:37
Definition testingDetails.hpp:15
unsigned long long sumSquares(unsigned long long iter)
Definition testingDetails.hpp:48
void voidSumSquares(unsigned long long iter)
Definition testingDetails.hpp:58
Definition testingDetails.hpp:17
unsigned long long operator()(unsigned long long iter) const
Definition testingDetails.hpp:18