Home | History | Annotate | Download | only in tools

Lines Matching refs:to_bytes

313 ATF_TEST_CASE(to_bytes);
314 ATF_TEST_CASE_HEAD(to_bytes)
316 set_md_var("descr", "Tests the to_bytes function");
318 ATF_TEST_CASE_BODY(to_bytes)
320 using tools::text::to_bytes;
322 ATF_REQUIRE_EQ(0, to_bytes("0"));
323 ATF_REQUIRE_EQ(12345, to_bytes("12345"));
324 ATF_REQUIRE_EQ(2 * 1024, to_bytes("2k"));
325 ATF_REQUIRE_EQ(4 * 1024 * 1024, to_bytes("4m"));
326 ATF_REQUIRE_EQ(int64_t(8) * 1024 * 1024 * 1024, to_bytes("8g"));
327 ATF_REQUIRE_EQ(int64_t(16) * 1024 * 1024 * 1024 * 1024, to_bytes("16t"));
329 ATF_REQUIRE_THROW_RE(std::runtime_error, "Empty", to_bytes(""));
331 to_bytes("12d"));
332 ATF_REQUIRE_THROW(std::runtime_error, to_bytes(" "));
333 ATF_REQUIRE_THROW(std::runtime_error, to_bytes(" k"));
387 ATF_ADD_TEST_CASE(tcs, to_bytes);