aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanJacobs2022-04-15 17:06:30 +0200
committerSanJacobs2022-04-15 17:06:30 +0200
commit16947f5750c323f8d457f8942578a544bb35118e (patch)
tree3e5537edb3631efd8de54dfd966384551b81147e /src
parenta3479a81743d551f0a460a8a80081c0f04553afe (diff)
downloadsatscalc-16947f5750c323f8d457f8942578a544bb35118e.tar.gz
satscalc-16947f5750c323f8d457f8942578a544bb35118e.tar.bz2
satscalc-16947f5750c323f8d457f8942578a544bb35118e.zip
Added a bunch of tests for wind()
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c241771..c6e26d3 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -37,7 +37,7 @@ int main()
moment wraptime{30, 16, 27, 11, 2010};
timeblock workday{calltime, wraptime};
- std::cout << " --- TEST ---\n\n";
+ std::cout << "\n\n --- TIME UNITS TEST ---\n\n";
std::cout << "Calltime: " << timeprint(calltime) << std::endl;
std::cout << "Wraptime: " << timeprint(wraptime) << std::endl;
@@ -54,6 +54,38 @@ int main()
std::cout << "\nSecond_half:\n";
std::cout << timeprint(second_half.start) << " --> " << timeprint(second_half.end) << std::endl;
+ std::cout << "\n\n --- TIME MATH TEST ---\n\n";
+
+ moment testtime{30, 8, 25, 2, 2012};
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+
+ std::cout << "\nForwarding 45 minutes...\n";
+ wind(testtime, 45, 0, 0);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+ std::cout << "\nRewinding 45 minutes...\n";
+ wind(testtime, -45, 0, 0);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+
+ std::cout << "\nForwarding 20 hours...\n";
+ wind(testtime, 0, 20, 0);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+ std::cout << "\nRewinding 20 hours...\n";
+ wind(testtime, 0, -20, 0);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+
+ std::cout << "\nForwarding 10 days...\n";
+ wind(testtime, 0, 0, 10);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
+ std::cout << "\nRewinding 10 days...\n";
+ wind(testtime, 0, 0, -10);
+ std::cout << "Testtime: " << timeprint(testtime) << std::endl;
+
return 0;
}