File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1818
1919#include < gtest/gtest.h>
2020
21+ #include < chrono>
22+
23+ namespace {
24+
25+ int get_current_year (void )
26+ {
27+ auto now = std::chrono::system_clock::now ();
28+ std::time_t current_time = std::chrono::system_clock::to_time_t (now);
29+ std::tm* timeinfo = std::localtime (¤t_time);
30+
31+ int year = timeinfo->tm_year + 1900 ;
32+ return year;
33+ }
34+
35+ }
36+
2137TEST (vconone, version_number)
2238{
2339 auto v = vconone::get_number ();
@@ -45,5 +61,14 @@ TEST(vconone, copyright)
4561{
4662 auto str = vconone::get_copyright ();
4763
64+ int year = 2024 ;
65+
66+ if (year < get_current_year ()){
67+ std::cout << " !!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!\r\n " ;
68+ std::cout << " \t Please update vconone year.\r\n " ;
69+ std::cout << " \t It seems it's a new year and vconcone is not updated.\r\n " ;
70+ std::cout << " \t Happy new year!\r\n " ;
71+ }
72+
4873 ASSERT_NE (" " , str);
4974}
You can’t perform that action at this time.
0 commit comments