File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 18
18
19
19
#include < gtest/gtest.h>
20
20
21
+ #include < chrono>
22
+
23
+ namespace
24
+ {
25
+
26
+ int get_current_year (void )
27
+ {
28
+ auto now = std::chrono::system_clock::now ();
29
+ std::time_t current_time = std::chrono::system_clock::to_time_t (now);
30
+ std::tm *timeinfo = std::localtime (¤t_time);
31
+
32
+ int year = timeinfo->tm_year + 1900 ;
33
+ return year;
34
+ }
35
+
36
+ } // namespace
37
+
21
38
TEST (vconone, version_number)
22
39
{
23
40
auto v = vconone::get_number ();
@@ -45,5 +62,15 @@ TEST(vconone, copyright)
45
62
{
46
63
auto str = vconone::get_copyright ();
47
64
65
+ int year = 2024 ;
66
+
67
+ if (year < get_current_year ())
68
+ {
69
+ std::cout << " !!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!\r\n " ;
70
+ std::cout << " \t Please update vconone year.\r\n " ;
71
+ std::cout << " \t It seems it's a new year and vconcone is not updated.\r\n " ;
72
+ std::cout << " \t Happy new year!\r\n " ;
73
+ }
74
+
48
75
ASSERT_NE (" " , str);
49
76
}
You can’t perform that action at this time.
0 commit comments