Commit ecc64101 authored by Vít Starý Novotný's avatar Vít Starý Novotný
Browse files

Fixed the XMLParser::return_data_type_coerce exception message.

parent aaf6c5cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ DataType XMLParser::return_data_type_coerce(
    if (expected_type == actual_type || (expected_type == DT_DOUBLE && actual_type == DT_INTEGER))
        return expected_type;
    else if (expected_type == DT_INTEGER && actual_type == DT_DOUBLE)
        cannot_coerce(where, "integer", "double");
        cannot_coerce(where, "double", "integer");
    assert(false); // Should never reach here.
}

+2 −2
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ TEST(XMLParser, cannotCoerceAssignment)
    std::istringstream error_stream_in(error_stream_out.str());
    std::string line;
    std::getline(error_stream_in, line);
    ASSERT_EQ("Parser error:\tType error from (Relational equality operator, \"=\") at line 2, character number 3: Cannot coerce integer to double.", line);
    ASSERT_EQ("Parser error:\tType error from (Relational equality operator, \"=\") at line 2, character number 3: Cannot coerce double to integer.", line);
}

TEST(XMLParser, cannotCoerceReturn)
@@ -160,5 +160,5 @@ TEST(XMLParser, cannotCoerceReturn)
    std::istringstream error_stream_in(error_stream_out.str());
    std::string line;
    std::getline(error_stream_in, line);
    ASSERT_EQ("Parser error:\tType error from (Identifier, \"return\") at line 2, character number 3: Cannot coerce integer to double.", line);
    ASSERT_EQ("Parser error:\tType error from (Identifier, \"return\") at line 2, character number 3: Cannot coerce double to integer.", line);
}