From 659a1f12d935130bf8da4fe14165e4f421ac7c18 Mon Sep 17 00:00:00 2001 From: arthurtspears Date: Sat, 20 Apr 2024 11:16:36 -0700 Subject: Adding basic unit tests to Solution (#2) * all work up until inclass practice * Added Unit Tests Project * Added second unit tests project as example. * Bring up to date for merge --- CST 126/Homework 1/helpers.hpp | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 CST 126/Homework 1/helpers.hpp (limited to 'CST 126/Homework 1/helpers.hpp') diff --git a/CST 126/Homework 1/helpers.hpp b/CST 126/Homework 1/helpers.hpp new file mode 100644 index 0000000..8225722 --- /dev/null +++ b/CST 126/Homework 1/helpers.hpp @@ -0,0 +1,44 @@ +#ifndef HELPERS_HPP +#define HELPERS_HPP + +#include + +typedef unsigned long long uLong; +typedef unsigned char BYTE; + +inline int Random(const int& lowest, const int& highest) +{ + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution dis(lowest, highest); + const int random_number = dis(gen); + return random_number; +} + +inline void GenerateRandomNumbers(int arrayToFill[], const int& size) +{ + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution dis(0, size); + for (auto i = 0; i < size; ++i) + { + const int random_number = dis(gen); + arrayToFill[i] = random_number; + } +} +inline int add(int num, char myChar) +{ + return num + myChar; +} +inline int add(int num, int num2, int num3) +{ + return num + num2 + num3; +} +inline int add(int num, int num2, int num3, int num4) +{ + return num + num2 + num3 + num4; +} + + + +#endif -- cgit v1.2.3