4 #include <catch_ros/catch.hpp> 6 #include "../../src/launch/bytes_parser.h" 14 const std::vector<std::pair<std::string, uint64_t>> EXAMPLES{
19 {
"1.6 GB", 1600000000ULL},
20 {
"1 gB", 1000000000ULL},
21 {
"3250 KiB", 3250*1ull<<10},
22 {
"40 MiB", 40*1ull<<20},
24 {
"0.5 TiB", (1ull<<40)/2}
27 for(
const auto& example : EXAMPLES)
33 CAPTURE(example.first);
35 CHECK(memory == example.second);
TEST_CASE("parse memory size","[memory]")
std::tuple< uint64_t, bool > parseMemory(const std::string &memory)