File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-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+
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+
2138TEST (vconone, version_number)
2239{
2340 auto v = vconone::get_number ();
@@ -45,5 +62,15 @@ TEST(vconone, copyright)
4562{
4663 auto str = vconone::get_copyright ();
4764
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+
4875 ASSERT_NE (" " , str);
4976}
You can’t perform that action at this time.
0 commit comments