corvvs / webserv

simple and light http-server like NGINX in C++
4 stars 2 forks source link

fix_to_compile_on_Linux #250

Closed nao215912 closed 2 years ago

nao215912 commented 2 years ago

Linux上でコンパイルが通るようになったんですが、こけるテストもありました

[  FAILED  ] 11 tests, listed below:
[  FAILED  ] control_header_http.date_basic_ok
[  FAILED  ] control_header_http.set_cookie_basic_ok
[  FAILED  ] parser_helper_str_to_http_date.imf_fixdate_ok_unixtime_origin
[  FAILED  ] parser_helper_str_to_http_date.imf_fixdate_ok_unixtime_origin_1
[  FAILED  ] parser_helper_str_to_http_date.imf_fixdate_ok_unixtime_now
[  FAILED  ] parser_helper_str_to_http_date.asctime_ok_unixtime_origin
[  FAILED  ] parser_helper_str_to_http_date.asctime_ok_unixtime_origin_1
[  FAILED  ] parser_helper_str_to_http_date.asctime_ok_unixtime_now
[  FAILED  ] parser_helper_str_to_http_date.rfc850_date_ok_unixtime_origin
[  FAILED  ] parser_helper_str_to_http_date.rfc850_date_ok_unixtime_origin_1
[  FAILED  ] parser_helper_str_to_http_date.rfc850_date_ok_unixtime_now
corvvs commented 2 years ago

手元ですぐにLinuxで試せないので、こけ方の情報が欲しいです。 (どのテストケースがどうNGなのか)

nao215912 commented 2 years ago
TEST(parser_helper_str_to_http_date, rfc850_date_ok_unixtime_now) {
    const HTTP::byte_string str          = HTTP::strfy("Wednesday, 10-Aug-22 02:09:46 GMT");
    std::pair<bool, t_time_epoch_ms> res = ParserHelper::http_date_to_time(str);
    EXPECT_TRUE(res.first);
// res.second =1660093786000
    EXPECT_EQ(1660097386000, res.second);
}
nao215912 commented 2 years ago
TEST(parser_helper_str_to_http_date, rfc850_date_ok_unixtime_origin_1) {
    const HTTP::byte_string str          = HTTP::strfy("Sunday, 01-Jan-70 00:00:01 GMT");
    std::pair<bool, t_time_epoch_ms> res = ParserHelper::http_date_to_time(str);
    EXPECT_TRUE(res.first);
//res.second = 18446744073705952616
    EXPECT_EQ(1000, res.second);
}
ryo-manba commented 2 years ago

テストがコケてるのはタイムゾーンの違いっぽい

ryo-manba commented 2 years ago

https://github.com/corvvs/webserv/pull/253 で対応