First Commit
This commit is contained in:
commit
8a6c7106e3
1312 files changed
+425396
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include "catch.hpp"
|
||||
|
||||
#include <osmium/util/double.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
TEST_CASE("Check double2string function") {
|
||||
std::string s1;
|
||||
osmium::double2string(s1, 1.123, 7);
|
||||
REQUIRE(s1 == "1.123");
|
||||
|
||||
std::string s2;
|
||||
osmium::double2string(s2, 1.000, 7);
|
||||
REQUIRE(s2 == "1");
|
||||
|
||||
std::string s3;
|
||||
osmium::double2string(s3, 0.0, 7);
|
||||
REQUIRE(s3 == "0");
|
||||
|
||||
std::string s4;
|
||||
osmium::double2string(s4, 0.020, 7);
|
||||
REQUIRE(s4 == "0.02");
|
||||
|
||||
std::string s5;
|
||||
osmium::double2string(s5, -0.020, 7);
|
||||
REQUIRE(s5 == "-0.02");
|
||||
|
||||
std::string s6;
|
||||
osmium::double2string(s6, -0.0, 7);
|
||||
REQUIRE(s6 == "-0");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user