Skip to content

Commit

Permalink
fix unit tests"
Browse files Browse the repository at this point in the history
gst
  • Loading branch information
ggjulio committed Nov 2, 2021
1 parent 13bd853 commit d324ffd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions tests/config_files/testParser.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ server {
autoindex on;
include fastcgi_params;
cgi_exec ./Makefile;
cgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# cgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
return 307 php-cgi;
}

Expand Down Expand Up @@ -55,8 +55,8 @@ server {
autoindex off;
include fastcgi_params;
cgi_exec ./Makefile;
cgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
cgi_param SERVER_NAME $server_name;
# cgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# cgi_param SERVER_NAME $server_name;
return 307 ruby-cgi;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/src/TestsHtmlBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TEST_CASE("html::Builder2", "[namespace][html][builder][element]")
while (it != ft::filesystem::directory_iterator())
{
pre.addChild(
html::Builder("a", it->path().filename()).addAttribute("href", it->path().filename())
html::Builder("a", it->getPath().filename()).addAttribute("href", it->getPath().filename())
);
++it;
}
Expand Down
18 changes: 9 additions & 9 deletions tests/src/TestsServerConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ TEST_CASE_METHOD(SingletonFixture, "ServerConfig1 - ./config_files/testParser.co
CHECK( config.getServer(1).getLocations()[1].getReturnDirective().getUri() == "ruby-cgi");

// cgi_param directive
CHECK( config.getServer(0).getLocations()[0].getCgiParams().size() == 0);
CHECK( config.getServer(0).getLocations()[1].getCgiParams().size() == 0);
CHECK( config.getServer(0).getLocations()[2].getCgiParams().size() == 1);
CHECK( config.getServer(0).getLocations()[2].getCgiParam("SCRIPT_FILENAME") == "$document_root$fastcgi_script_name");

CHECK( config.getServer(1).getLocations()[0].getCgiParams().size() == 0);
CHECK( config.getServer(1).getLocations()[1].getCgiParams().size() == 2);
CHECK( config.getServer(1).getLocations()[1].getCgiParam("SCRIPT_FILENAME") == "$document_root$fastcgi_script_name");
CHECK( config.getServer(1).getLocations()[1].getCgiParam("SERVER_NAME") == "$server_name");
// CHECK( config.getServer(0).getLocations()[0].getCgiParams().size() == 0);
// CHECK( config.getServer(0).getLocations()[1].getCgiParams().size() == 0);
// CHECK( config.getServer(0).getLocations()[2].getCgiParams().size() == 1);
// CHECK( config.getServer(0).getLocations()[2].getCgiParam("SCRIPT_FILENAME") == "$document_root$fastcgi_script_name");

// CHECK( config.getServer(1).getLocations()[0].getCgiParams().size() == 0);
// CHECK( config.getServer(1).getLocations()[1].getCgiParams().size() == 2);
// CHECK( config.getServer(1).getLocations()[1].getCgiParam("SCRIPT_FILENAME") == "$document_root$fastcgi_script_name");
// CHECK( config.getServer(1).getLocations()[1].getCgiParam("SERVER_NAME") == "$server_name");

// client_max_body_size directive
CHECK( config.getServer(0).getClientMaxBodySize() == (1000 * 1000) );
Expand Down
14 changes: 7 additions & 7 deletions tests/src/ft/TestsFilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ TEST_CASE("fs::directory_entry - class directory_entry", "[namespace][ft][filesy
TemporaryDirectory t;
ft::error_code ec;
fs::directory_entry de = fs::directory_entry(t.path().c_str());
CHECK(de.path().string() == t.path().string());
CHECK(de.getPath().string() == t.path().string());
CHECK((fs::path)de == fs::path(t.path().c_str()));
CHECK(de.exists());
CHECK(!de.is_block_file());
Expand Down Expand Up @@ -212,7 +212,7 @@ TEST_CASE("fs::directory_entry - class directory_entry", "[namespace][ft][filesy
CHECK_NOTHROW(de.assign(fs::path(t.path().c_str()) / "foo", ec));
CHECK(!ec);
de = fs::directory_entry(fs::path(t.path().c_str()) / "foo");
CHECK(de.path() == fs::path(t.path().c_str()) / "foo");
CHECK(de.getPath() == fs::path(t.path().c_str()) / "foo");
CHECK(de.exists());
CHECK(de.exists(ec));
CHECK(!ec);
Expand Down Expand Up @@ -556,12 +556,12 @@ TEST_CASE("fs::directory_iterator - class directory_iterator", "[namespace][ft][
fs::directory_iterator iter2(iter);
fs::directory_iterator iter3, iter4;
iter3 = iter;
CHECK(iter->path().filename() == "test");
CHECK(iter2->path().filename() == "test");
CHECK(iter3->path().filename() == "test");
CHECK(iter->getPath().filename() == "test");
CHECK(iter2->getPath().filename() == "test");
CHECK(iter3->getPath().filename() == "test");
iter4 = std::move(iter3);
CHECK(iter4->path().filename() == "test");
CHECK(iter->path() == fs::path(t.path().c_str()) / "test");
CHECK(iter4->getPath().filename() == "test");
CHECK(iter->getPath() == fs::path(t.path().c_str()) / "test");
CHECK(!iter->is_symlink());
CHECK(iter->is_regular_file());
CHECK(!iter->is_directory());
Expand Down

0 comments on commit d324ffd

Please sign in to comment.