-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_daily.cc
46 lines (31 loc) · 1.05 KB
/
test_daily.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#if !DAILY_TEST_CUSTOM_CONFIG
#define DAILY_TEST_CASE(name) static void name()
#define DAILY_TEST_ASSERT(b) assert(b)
#endif // DAILY_TEST_CUSTOM_CONFIG
#include <cassert>
#include <string>
#include <iostream>
#include <sstream>
#include "daily.h"
#include <string>
#include <vector>
#include <set>
#include <map>
#include <list>
using namespace daily;
DAILY_TEST_CASE(daily_test) {
std::cout << "----Start testing----\n" << std::flush;
std::cout << ">> Testing Mathmatics \n" << std::flush;
DAILY_TEST_ASSERT(InRange(2, 0, 2) == true);
DAILY_TEST_ASSERT(InRange('a', 'b', 'z') == false);
DAILY_TEST_ASSERT(InRange(1.0, 0.0, 2.0) == true);
std::cout << ">> Testing String \n" << std::flush;
std::string rand_str = GenerateRandomString(8);
DAILY_TEST_ASSERT(rand_str.length() == 8);
std::cout << ">> Testing Time \n" << std::flush;
std::cout << GetCurrentDateTime() << std::endl;
std::cout << "Congratulations, all tests are passed!!!\n" << std::flush;
}
int main(int argc, char **argv) {
daily_test();
}