Loading tests/unit/test_guided_distributor.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -14,11 +14,27 @@ #include <catch2/catch.hpp> #include <fmt/format.h> #include <global/rpc/distributor.hpp> #include <fstream> TEST_CASE( "Guided distributor Testing", "[Distributor]" ) { GIVEN( "A distributor" ) { std::ofstream o; o.open("/tmp/guided.txt"); o << "/t.c01 0 3" << std::endl; o << "/t.c02 0 3" << std::endl; o << "/t.c01 1 3" << std::endl; o << "/t.c02 1 3" << std::endl; o << "/t.c01 2 3" << std::endl; o << "/t.c02 2 3" << std::endl; o << "/t.c03 1 3" << std::endl; o << "/t.c04 1 3" << std::endl; o << "/t.c05 1 3" << std::endl; o << "/t.c06 1 3" << std::endl; o << "/t.c07 1 3" << std::endl; o.close(); auto d = gkfs::rpc::GuidedDistributor(); REQUIRE( d.locate_data("/t.c01",1,10) == 3 ); Loading Loading
tests/unit/test_guided_distributor.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -14,11 +14,27 @@ #include <catch2/catch.hpp> #include <fmt/format.h> #include <global/rpc/distributor.hpp> #include <fstream> TEST_CASE( "Guided distributor Testing", "[Distributor]" ) { GIVEN( "A distributor" ) { std::ofstream o; o.open("/tmp/guided.txt"); o << "/t.c01 0 3" << std::endl; o << "/t.c02 0 3" << std::endl; o << "/t.c01 1 3" << std::endl; o << "/t.c02 1 3" << std::endl; o << "/t.c01 2 3" << std::endl; o << "/t.c02 2 3" << std::endl; o << "/t.c03 1 3" << std::endl; o << "/t.c04 1 3" << std::endl; o << "/t.c05 1 3" << std::endl; o << "/t.c06 1 3" << std::endl; o << "/t.c07 1 3" << std::endl; o.close(); auto d = gkfs::rpc::GuidedDistributor(); REQUIRE( d.locate_data("/t.c01",1,10) == 3 ); Loading