fix tests

This commit is contained in:
Jacob Dufault 2017-03-08 00:09:15 -08:00
parent 6519dc1b8d
commit 4e2f24ac17
15 changed files with 15 additions and 15 deletions

View File

@ -24,6 +24,15 @@ void Reflect(Writer& visitor, std::string& value) {
} }
// ReflectMember
void ReflectMember(Writer& visitor, const char* name, std::string& value) {
if (value.empty())
return;
visitor.Key(name);
Reflect(visitor, value);
}
// Location // Location
void Reflect(Reader& visitor, Location& value) { void Reflect(Reader& visitor, Location& value) {
value = Location(visitor.GetString()); value = Location(visitor.GetString());

View File

@ -110,6 +110,7 @@ void ReflectMember(Writer& visitor, const char* name, optional<T>& value) {
visitor.Key(name); visitor.Key(name);
Reflect(visitor, value); Reflect(visitor, value);
} }
void ReflectMember(Writer& visitor, const char* name, std::string& value);
// Reader: // Reader:
template<typename T> template<typename T>

View File

@ -7,7 +7,6 @@ void foo();
// Note: we always use the latest seen ("most local") definition/declaration. // Note: we always use the latest seen ("most local") definition/declaration.
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@foo#", "usr": "c:@F@foo#",

View File

@ -43,7 +43,6 @@ OUTPUT:
"definition": "1:7:11", "definition": "1:7:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:4:8", "1:7:11"] "uses": ["1:4:8", "1:7:11"]
}], }]
"vars": []
} }
*/ */

View File

@ -3,7 +3,6 @@ void foo(int a, int b);
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@foo#I#I#", "usr": "c:@F@foo#I#I#",

View File

@ -5,7 +5,6 @@ void foo() {}
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@foo#", "usr": "c:@F@foo#",

View File

@ -3,7 +3,6 @@ void foo() {}
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@foo#", "usr": "c:@F@foo#",

View File

@ -27,7 +27,6 @@ OUTPUT:
"definition": "1:6:11", "definition": "1:6:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:3:8", "1:6:11"] "uses": ["1:3:8", "1:6:11"]
}], }]
"vars": []
} }
*/ */

View File

@ -16,7 +16,7 @@ OUTPUT:
"funcs": [0], "funcs": [0],
"uses": ["*1:2:7"] "uses": ["*1:2:7"]
}], }],
"functions": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@N@hello@S@Foo@F@foo#", "usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",

View File

@ -29,7 +29,7 @@ OUTPUT:
"callees": ["0@1:7:7", "0@1:9:3"], "callees": ["0@1:7:7", "0@1:9:3"],
"uses": ["1:6:6"] "uses": ["1:6:6"]
}], }],
"variables": [{ "vars": [{
"id": 0, "id": 0,
"usr": "c:@N@ns@Foo", "usr": "c:@N@ns@Foo",
"short_name": "Foo", "short_name": "Foo",

View File

@ -17,7 +17,6 @@ OUTPUT:
"definition": "1:3:9", "definition": "1:3:9",
"uses": ["*1:3:9", "*1:5:3", "*1:6:3"] "uses": ["*1:3:9", "*1:5:3", "*1:6:3"]
}], }],
"funcs": [],
"vars": [{ "vars": [{
"id": 0, "id": 0,
"usr": "c:@N@ns@a", "usr": "c:@N@ns@a",

View File

@ -12,7 +12,6 @@ int b = foo<bool>();
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#", "usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#",

View File

@ -6,7 +6,6 @@ void usage() {
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@foo#", "usr": "c:@F@foo#",

View File

@ -33,7 +33,7 @@ OUTPUT:
}], }],
"vars": [{ "vars": [{
"id": 0, "id": 0,
"usr": "c:type_usage_various.cc@58@S@Foo@F@make#@f", "usr": "c:type_usage_various.cc@57@S@Foo@F@make#@f",
"short_name": "f", "short_name": "f",
"qualified_name": "f", "qualified_name": "f",
"definition": "1:6:7", "definition": "1:6:7",

View File

@ -10,7 +10,6 @@ void caller() {
/* /*
OUTPUT: OUTPUT:
{ {
"types": [],
"funcs": [{ "funcs": [{
"id": 0, "id": 0,
"usr": "c:@F@called#", "usr": "c:@F@called#",