Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

(fix) fixed VS build #586

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ image:
- Visual Studio 2015
- Visual Studio 2017

environment:
matrix:
- VS_VERSION:
- VS_VERSION: debug

install:
- set PATH=C:\Ruby25\bin;%PATH%

Expand Down
8 changes: 4 additions & 4 deletions ext/snowcrash/test/test-ActionParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ TEST_CASE("Named Endpoint", "[named_endpoint]")
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 1);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().at(0).element == Element::ResourceElement);

Resource resource = blueprint.node.content.elements().at(0).content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.elements().at(0).content.resource;
REQUIRE(resource.name == "My Named Endpoint");
REQUIRE(resource.uriTemplate == "/test/endpoint");
REQUIRE(resource.actions.size() == 1);
Expand Down Expand Up @@ -591,7 +591,7 @@ TEST_CASE("Named Endpoints Edge Cases", "[named_endpoint]")
REQUIRE(blueprint.node.content.elements().at(2).content.elements().size() == 0);

{
Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.name == "Endpoint 1");
REQUIRE(resource.uriTemplate == "/e1");
REQUIRE(resource.actions.size() == 1);
Expand All @@ -601,7 +601,7 @@ TEST_CASE("Named Endpoints Edge Cases", "[named_endpoint]")
}

{
Resource resource = blueprint.node.content.elements().at(1).content.resource;
const Resource& resource = blueprint.node.content.elements().at(1).content.resource;
REQUIRE(resource.name == "Endpoint 2");
REQUIRE(resource.uriTemplate == "/e1");
REQUIRE(resource.actions.size() == 1);
Expand All @@ -611,7 +611,7 @@ TEST_CASE("Named Endpoints Edge Cases", "[named_endpoint]")
}

{
Resource resource = blueprint.node.content.elements().at(2).content.resource;
const Resource& resource = blueprint.node.content.elements().at(2).content.resource;
REQUIRE(resource.name == "Endpoint 3");
REQUIRE(resource.uriTemplate == "/e1");
REQUIRE(resource.actions.size() == 1);
Expand Down
8 changes: 4 additions & 4 deletions ext/snowcrash/test/test-BlueprintParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ TEST_CASE("Parse API with Name and abbreviated resource", "[blueprint]")
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/resource");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions.front().examples.size() == 1);
Expand Down Expand Up @@ -442,7 +442,7 @@ TEST_CASE("Parsing unexpected blocks", "[blueprint]")
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "GET");
Expand Down Expand Up @@ -902,7 +902,7 @@ TEST_CASE(
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource r = blueprint.node.content.elements().at(0).content.resource;
const Resource& r = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(r.name == "Post");
REQUIRE(r.attributes.typeDefinition.baseType == mson::ImplicitObjectBaseType);
REQUIRE(r.attributes.typeDefinition.typeSpecification.name.symbol.literal == "B");
Expand Down Expand Up @@ -1294,7 +1294,7 @@ TEST_CASE("Any named type data structure should be able to be overridden when re
REQUIRE(blueprint.node.content.elements().at(1).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(1).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(1).content.resource;
const Resource& resource = blueprint.node.content.elements().at(1).content.resource;
REQUIRE(resource.uriTemplate == "/sample");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions.at(0).method == "GET");
Expand Down
2 changes: 1 addition & 1 deletion ext/snowcrash/test/test-ParametersParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST_CASE("Percentage encoded characters in parameter name ", "[parameters][perc
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].description.empty());
REQUIRE(resource.actions[0].parameters.size() == 1);
Expand Down
66 changes: 37 additions & 29 deletions ext/snowcrash/test/test-ResourceGroupParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ TEST_CASE("Parse multiple resources with payloads", "[resource_group]")
REQUIRE(resourceGroup.node.content.elements().size() == 2);

REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);
Resource resource1 = resourceGroup.node.content.elements().at(0).content.resource;
const Resource& resource1 = resourceGroup.node.content.elements().at(0).content.resource;

REQUIRE(resource1.uriTemplate == "/1");
REQUIRE(resource1.description.empty());
Expand All @@ -169,7 +169,7 @@ TEST_CASE("Parse multiple resources with payloads", "[resource_group]")
REQUIRE(resource1.actions[0].examples[0].requests[0].body.empty());
REQUIRE(resource1.actions[0].examples[0].responses.empty());

Resource resource2 = resourceGroup.node.content.elements().at(1).content.resource;
const Resource& resource2 = resourceGroup.node.content.elements().at(1).content.resource;
REQUIRE(resource2.uriTemplate == "/2");
REQUIRE(resource2.description.empty());
REQUIRE(resource2.actions.size() == 1);
Expand Down Expand Up @@ -230,7 +230,7 @@ TEST_CASE("Parse resource with list in its description", "[resource_group]")
REQUIRE(resourceGroup.node.content.elements().size() == 1);
REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);

Resource resource = resourceGroup.node.content.elements().at(0).content.resource;
const Resource& resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/1");
REQUIRE(resource.description.empty());
REQUIRE(resource.actions.size() == 1);
Expand Down Expand Up @@ -286,7 +286,7 @@ TEST_CASE("Make sure method followed by a group does not eat the group", "[resou
REQUIRE(resourceGroup.node.content.elements().size() == 1);
REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);

Resource resource = resourceGroup.node.content.elements().at(0).content.resource;
const Resource& resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/1");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "POST");
Expand Down Expand Up @@ -316,7 +316,7 @@ TEST_CASE("Parse resource method abbreviation followed by a foreign method", "[r
REQUIRE(resourceGroup.node.content.elements().size() == 1);
REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);

Resource resource = resourceGroup.node.content.elements().at(0).content.resource;
const Resource& resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/resource");
REQUIRE(resource.model.name.empty());
Expand Down Expand Up @@ -349,21 +349,25 @@ TEST_CASE("Parse resource method abbreviation followed by another", "[resource_g
REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(resourceGroup.node.content.elements().at(1).element == Element::ResourceElement);

Resource resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/resource");
REQUIRE(resource.model.name.empty());
REQUIRE(resource.model.body.empty());
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "GET");

resource = resourceGroup.node.content.elements().at(1).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/2");
REQUIRE(resource.model.name.empty());
REQUIRE(resource.model.body.empty());
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "POST");
{
const Resource& resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/resource");
REQUIRE(resource.model.name.empty());
REQUIRE(resource.model.body.empty());
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "GET");
}

{
const Resource& resource = resourceGroup.node.content.elements().at(1).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/2");
REQUIRE(resource.model.name.empty());
REQUIRE(resource.model.body.empty());
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "POST");
}

REQUIRE(resourceGroup.sourceMap.attributes.name.sourceMap.empty());
REQUIRE(resourceGroup.sourceMap.content.elements().collection.size() == 2);
Expand All @@ -389,15 +393,19 @@ TEST_CASE("Resource followed by a complete action", "[resource_group][regression
REQUIRE(resourceGroup.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(resourceGroup.node.content.elements().at(1).element == Element::ResourceElement);

Resource resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.name == "Resource");
REQUIRE(resource.uriTemplate == "/A");

resource = resourceGroup.node.content.elements().at(1).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/B");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "POST");
{
const Resource& resource = resourceGroup.node.content.elements().at(0).content.resource;
REQUIRE(resource.name == "Resource");
REQUIRE(resource.uriTemplate == "/A");
}

{
const Resource& resource = resourceGroup.node.content.elements().at(1).content.resource;
REQUIRE(resource.name.empty());
REQUIRE(resource.uriTemplate == "/B");
REQUIRE(resource.actions.size() == 1);
REQUIRE(resource.actions[0].method == "POST");
}

SourceMap<Resource> resourceSM = resourceGroup.sourceMap.content.elements().collection[0].content.resource;
SourceMapHelper::check(resourceSM.name.sourceMap, 0, 16);
Expand Down
4 changes: 2 additions & 2 deletions ext/snowcrash/test/test-ResourceParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ TEST_CASE("Parse named resource with lazy referencing", "[resource][model][issue
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/1");
REQUIRE(resource.name == "Resource 1");

Expand Down Expand Up @@ -580,7 +580,7 @@ TEST_CASE("Parse named resource with lazy referencing with both response and req
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.uriTemplate == "/items");
REQUIRE(resource.name == "Collection of Items");

Expand Down
4 changes: 2 additions & 2 deletions ext/snowcrash/test/test-SymbolIdentifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TEST_CASE("Punctuation in identifiers", "[symbol_identifier]")
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.name == "Parcel's sticker @#!$%^&*=-?><,.~`\"'");
REQUIRE(resource.uriTemplate == "/");
REQUIRE(resource.actions.empty());
Expand All @@ -52,7 +52,7 @@ TEST_CASE("Non ASCII characters in identifiers", "[symbol_identifier]")
REQUIRE(blueprint.node.content.elements().at(0).element == Element::ResourceElement);
REQUIRE(blueprint.node.content.elements().at(0).content.elements().size() == 0);

Resource resource = blueprint.node.content.elements().at(0).content.resource;
const Resource& resource = blueprint.node.content.elements().at(0).content.resource;
REQUIRE(resource.name == "\xD0\x9A\xD0\xB0\xD1\x82\xD0\xB5\xD0\xB3\xD0\xBE\xD1\x80\xD0\xB8\xD0\xB8");
REQUIRE(resource.uriTemplate == "/");
REQUIRE(resource.actions.empty());
Expand Down
Loading