🔨 fixed compilation error
This commit is contained in:
		
							parent
							
								
									e6aa700360
								
							
						
					
					
						commit
						3d589fd032
					
				
					 4 changed files with 24 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -182,32 +182,32 @@ TEST_CASE("const_iterator class")
 | 
			
		|||
            {
 | 
			
		||||
                json j(json::value_t::null);
 | 
			
		||||
                json::const_iterator it = j.cbegin();
 | 
			
		||||
                CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
                CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("number")
 | 
			
		||||
            {
 | 
			
		||||
                json j(17);
 | 
			
		||||
                json::const_iterator it = j.cbegin();
 | 
			
		||||
                CHECK(it->type_name() == "number");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "number");
 | 
			
		||||
                it = j.cend();
 | 
			
		||||
                CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
                CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("object")
 | 
			
		||||
            {
 | 
			
		||||
                json j({{"foo", "bar"}});
 | 
			
		||||
                json::const_iterator it = j.cbegin();
 | 
			
		||||
                CHECK(it->type_name() == "string");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "string");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("array")
 | 
			
		||||
            {
 | 
			
		||||
                json j({1, 2, 3, 4});
 | 
			
		||||
                json::const_iterator it = j.cbegin();
 | 
			
		||||
                CHECK(it->type_name() == "number");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "number");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -166,32 +166,32 @@ TEST_CASE("iterator class")
 | 
			
		|||
            {
 | 
			
		||||
                json j(json::value_t::null);
 | 
			
		||||
                json::iterator it = j.begin();
 | 
			
		||||
                CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
                CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("number")
 | 
			
		||||
            {
 | 
			
		||||
                json j(17);
 | 
			
		||||
                json::iterator it = j.begin();
 | 
			
		||||
                CHECK(it->type_name() == "number");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "number");
 | 
			
		||||
                it = j.end();
 | 
			
		||||
                CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
                CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
 | 
			
		||||
                CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("object")
 | 
			
		||||
            {
 | 
			
		||||
                json j({{"foo", "bar"}});
 | 
			
		||||
                json::iterator it = j.begin();
 | 
			
		||||
                CHECK(it->type_name() == "string");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "string");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SECTION("array")
 | 
			
		||||
            {
 | 
			
		||||
                json j({1, 2, 3, 4});
 | 
			
		||||
                json::iterator it = j.begin();
 | 
			
		||||
                CHECK(it->type_name() == "number");
 | 
			
		||||
                CHECK(std::string(it->type_name()) == "number");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,15 +45,15 @@ TEST_CASE("convenience functions")
 | 
			
		|||
{
 | 
			
		||||
    SECTION("type name as string")
 | 
			
		||||
    {
 | 
			
		||||
        CHECK(json(json::value_t::null).type_name() == "null");
 | 
			
		||||
        CHECK(json(json::value_t::object).type_name() == "object");
 | 
			
		||||
        CHECK(json(json::value_t::array).type_name() == "array");
 | 
			
		||||
        CHECK(json(json::value_t::number_integer).type_name() == "number");
 | 
			
		||||
        CHECK(json(json::value_t::number_unsigned).type_name() == "number");
 | 
			
		||||
        CHECK(json(json::value_t::number_float).type_name() == "number");
 | 
			
		||||
        CHECK(json(json::value_t::boolean).type_name() == "boolean");
 | 
			
		||||
        CHECK(json(json::value_t::string).type_name() == "string");
 | 
			
		||||
        CHECK(json(json::value_t::discarded).type_name() == "discarded");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::null).type_name()) == "null");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::object).type_name()) == "object");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::array).type_name()) == "array");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::number_integer).type_name()) == "number");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::number_unsigned).type_name()) == "number");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::number_float).type_name()) == "number");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::boolean).type_name()) == "boolean");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::string).type_name()) == "string");
 | 
			
		||||
        CHECK(std::string(json(json::value_t::discarded).type_name()) == "discarded");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    SECTION("string escape")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue