Skip to content

Commit 5e84e6c

Browse files
committed
[vconone] Notice people to update year
But I am not sure this can work. ONE-DCO-Signed-off-by: Dayoung Lee <dayoung.lee@samsung.com>
1 parent bce28b1 commit 5e84e6c

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

compiler/vconone/src/version.test.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
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(&current_time);
30+
31+
int year = timeinfo->tm_year + 1900;
32+
return year;
33+
}
34+
35+
}
36+
2137
TEST(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 << "\tPlease update vconone year.\r\n";
69+
std::cout << "\tIt seems it's a new year and vconcone is not updated.\r\n";
70+
std::cout << "\tHappy new year!\r\n";
71+
}
72+
4873
ASSERT_NE("", str);
49-
}
74+
}

0 commit comments

Comments
 (0)