@@ -1780,10 +1780,10 @@ TEST(Value, TypeAndValuesMatchNullScalar) {
17801780}
17811781
17821782TEST (Value, TypeAndValuesMatchArray) {
1783- auto type = R"pb(
1783+ auto const * type = R"pb(
17841784 array_type { element_type { int64_type {} } }
17851785 )pb" ;
1786- auto matching_value = R"pb(
1786+ auto const * matching_value = R"pb(
17871787 array_value {
17881788 values { int_value: 1 }
17891789 values { int_value: 2 }
@@ -1793,10 +1793,10 @@ TEST(Value, TypeAndValuesMatchArray) {
17931793}
17941794
17951795TEST (Value, TypeAndValuesMatchArrayMismatchElementType) {
1796- auto type = R"pb(
1796+ auto const * type = R"pb(
17971797 array_type { element_type { int64_type {} } }
17981798 )pb" ;
1799- auto mismatched_value = R"pb(
1799+ auto const * mismatched_value = R"pb(
18001800 array_value {
18011801 values { int_value: 1 }
18021802 values { string_value: "2" }
@@ -1806,17 +1806,17 @@ TEST(Value, TypeAndValuesMatchArrayMismatchElementType) {
18061806}
18071807
18081808TEST (Value, TypeAndValuesMatchArrayMismatchScalar) {
1809- auto type = R"pb(
1809+ auto const * type = R"pb(
18101810 array_type { element_type { int64_type {} } }
18111811 )pb" ;
18121812 TestTypeAndValuesMatch (type, " int_value: 123" , false );
18131813}
18141814
18151815TEST (Value, TypeAndValuesMatchArrayWithNull) {
1816- auto type = R"pb(
1816+ auto const * type = R"pb(
18171817 array_type { element_type { int64_type {} } }
18181818 )pb" ;
1819- auto value_with_null = R"pb(
1819+ auto const * value_with_null = R"pb(
18201820 array_value {
18211821 values { int_value: 1 }
18221822 values {} # null
@@ -1827,7 +1827,7 @@ TEST(Value, TypeAndValuesMatchArrayWithNull) {
18271827}
18281828
18291829TEST (Value, TypeAndValuesMatchStruct) {
1830- auto type = R"pb(
1830+ auto const * type = R"pb(
18311831 struct_type {
18321832 fields {
18331833 field_name: "name"
@@ -1839,7 +1839,7 @@ TEST(Value, TypeAndValuesMatchStruct) {
18391839 }
18401840 }
18411841 )pb" ;
1842- auto matching_value = R"pb(
1842+ auto const * matching_value = R"pb(
18431843 array_value {
18441844 values { string_value: "John" }
18451845 values { int_value: 42 }
@@ -1849,7 +1849,7 @@ TEST(Value, TypeAndValuesMatchStruct) {
18491849}
18501850
18511851TEST (Value, TypeAndValuesMatchStructMismatchFieldType) {
1852- auto type = R"pb(
1852+ auto const * type = R"pb(
18531853 struct_type {
18541854 fields {
18551855 field_name: "name"
@@ -1861,7 +1861,7 @@ TEST(Value, TypeAndValuesMatchStructMismatchFieldType) {
18611861 }
18621862 }
18631863 )pb" ;
1864- auto mismatched_value = R"pb(
1864+ auto const * mismatched_value = R"pb(
18651865 array_value {
18661866 values { string_value: "John" }
18671867 values { string_value: "42" }
@@ -1871,13 +1871,13 @@ TEST(Value, TypeAndValuesMatchStructMismatchFieldType) {
18711871}
18721872
18731873TEST (Value, TypeAndValuesMatchStructMismatchFieldCount) {
1874- auto type = R"pb(
1874+ auto const * type = R"pb(
18751875 struct_type {
18761876 fields { type { string_type {} } }
18771877 fields { type { int64_type {} } }
18781878 }
18791879 )pb" ;
1880- auto mismatched_value = R"pb(
1880+ auto const * mismatched_value = R"pb(
18811881 array_value { values { string_value: "John" } }
18821882 )pb" ;
18831883 // The current implementation has a bug and will return true here.
@@ -1886,20 +1886,20 @@ TEST(Value, TypeAndValuesMatchStructMismatchFieldCount) {
18861886}
18871887
18881888TEST (Value, TypeAndValuesMatchStructMismatchScalar) {
1889- auto type = R"pb(
1889+ auto const * type = R"pb(
18901890 struct_type { fields { type { string_type {} } } }
18911891 )pb" ;
18921892 TestTypeAndValuesMatch (type, " string_value: 'John'" , false );
18931893}
18941894
18951895TEST (Value, TypeAndValuesMatchStructWithNull) {
1896- auto type = R"pb(
1896+ auto const * type = R"pb(
18971897 struct_type {
18981898 fields { type { string_type {} } }
18991899 fields { type { int64_type {} } }
19001900 }
19011901 )pb" ;
1902- auto value_with_null = R"pb(
1902+ auto const * value_with_null = R"pb(
19031903 array_value {
19041904 values { string_value: "John" }
19051905 values {}
@@ -1909,13 +1909,13 @@ TEST(Value, TypeAndValuesMatchStructWithNull) {
19091909}
19101910
19111911TEST (Value, TypeAndValuesMatchMap) {
1912- auto type = R"pb(
1912+ auto const * type = R"pb(
19131913 map_type {
19141914 key_type { string_type {} }
19151915 value_type { int64_type {} }
19161916 }
19171917 )pb" ;
1918- auto matching_value = R"pb(
1918+ auto const * matching_value = R"pb(
19191919 array_value {
19201920 values {
19211921 array_value {
@@ -1929,13 +1929,13 @@ TEST(Value, TypeAndValuesMatchMap) {
19291929}
19301930
19311931TEST (Value, TypeAndValuesMatchMapMismatchKeyType) {
1932- auto type = R"pb(
1932+ auto const * type = R"pb(
19331933 map_type {
19341934 key_type { string_type {} }
19351935 value_type { int64_type {} }
19361936 }
19371937 )pb" ;
1938- auto mismatched_value = R"pb(
1938+ auto const * mismatched_value = R"pb(
19391939 array_value {
19401940 values {
19411941 array_value {
@@ -1949,13 +1949,13 @@ TEST(Value, TypeAndValuesMatchMapMismatchKeyType) {
19491949}
19501950
19511951TEST (Value, TypeAndValuesMatchMapMismatchValueType) {
1952- auto type = R"pb(
1952+ auto const * type = R"pb(
19531953 map_type {
19541954 key_type { string_type {} }
19551955 value_type { int64_type {} }
19561956 }
19571957 )pb" ;
1958- auto mismatched_value = R"pb(
1958+ auto const * mismatched_value = R"pb(
19591959 array_value {
19601960 values {
19611961 array_value {
@@ -1969,7 +1969,7 @@ TEST(Value, TypeAndValuesMatchMapMismatchValueType) {
19691969}
19701970
19711971TEST (Value, TypeAndValuesMatchMapMismatchScalar) {
1972- auto type = R"pb(
1972+ auto const * type = R"pb(
19731973 map_type {
19741974 key_type { string_type {} }
19751975 value_type { int64_type {} }
@@ -1979,26 +1979,26 @@ TEST(Value, TypeAndValuesMatchMapMismatchScalar) {
19791979}
19801980
19811981TEST (Value, TypeAndValuesMatchMapMalformedEntry) {
1982- auto type = R"pb(
1982+ auto const * type = R"pb(
19831983 map_type {
19841984 key_type { string_type {} }
19851985 value_type { int64_type {} }
19861986 }
19871987 )pb" ;
1988- auto malformed_value = R"pb(
1988+ auto const * malformed_value = R"pb(
19891989 array_value { values { array_value { values { string_value: "key1" } } } }
19901990 )pb" ;
19911991 TestTypeAndValuesMatch (type, malformed_value, false );
19921992}
19931993
19941994TEST (Value, TypeAndValuesMatchMapWithNullValue) {
1995- auto type = R"pb(
1995+ auto const * type = R"pb(
19961996 map_type {
19971997 key_type { string_type {} }
19981998 value_type { int64_type {} }
19991999 }
20002000 )pb" ;
2001- auto value_with_null = R"pb(
2001+ auto const * value_with_null = R"pb(
20022002 array_value {
20032003 values {
20042004 array_value {
0 commit comments