Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: mojom/mojom_parser/serialization/serialization_test.go

Issue 1409063008: Replace newString() with stringPointer() or just &s where the compiler allows this. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/serialization/serialization.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/serialization/serialization_test.go
diff --git a/mojom/mojom_parser/serialization/serialization_test.go b/mojom/mojom_parser/serialization/serialization_test.go
index b8ccaf0fd2eda5738cbd84176c04557ff9e8511a..95fc4019d9e48d06086ebf2acfeb100070099aff 100644
--- a/mojom/mojom_parser/serialization/serialization_test.go
+++ b/mojom/mojom_parser/serialization/serialization_test.go
@@ -56,7 +56,7 @@ func (test *singleFileTest) addTestCase(moduleNameSpace, contents string) {
new(mojom_files.MojomFile), new(mojom_files.MojomFileGraph)})
test.expectedFile().FileName = fileName
- test.expectedFile().ModuleNamespace = newString(moduleNameSpace)
+ test.expectedFile().ModuleNamespace = &moduleNameSpace
test.expectedGraph().ResolvedTypes = make(map[string]mojom_types.UserDefinedType)
test.expectedGraph().ResolvedValues = make(map[string]mojom_types.UserDefinedValue)
@@ -73,8 +73,8 @@ func (test *singleFileTest) endTestCase() {
// newDeclData constructs a new DeclarationData with the given data.
func (test *singleFileTest) newDeclData(shortName, fullIdentifier string) *mojom_types.DeclarationData {
return &mojom_types.DeclarationData{
- ShortName: newString(shortName),
- FullIdentifier: newString(fullIdentifier),
+ ShortName: &shortName,
+ FullIdentifier: &fullIdentifier,
DeclaredOrdinal: -1,
DeclarationOrder: -1,
SourceFileInfo: &mojom_types.SourceFileInfo{
@@ -153,7 +153,7 @@ func TestSingleFileSerialization(t *testing.T) {
IntValue: 3,
InitializerValue: &mojom_types.ValueUserValueReference{mojom_types.UserValueReference{
Identifier: "NUM_MAGI",
- ValueKey: newString("TYPE_KEY:mojom.test.NUM_MAGI"),
+ ValueKey: stringPointer("TYPE_KEY:mojom.test.NUM_MAGI"),
ResolvedConcreteValue: &mojom_types.ValueLiteralValue{&mojom_types.LiteralValueInt64Value{3}},
}},
}}
@@ -163,8 +163,8 @@ func TestSingleFileSerialization(t *testing.T) {
// struct Foo
test.expectedGraph().ResolvedTypes["TYPE_KEY:mojom.test.Foo"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{
DeclData: &mojom_types.DeclarationData{
- ShortName: newString("Foo"),
- FullIdentifier: newString("mojom.test.Foo"),
+ ShortName: stringPointer("Foo"),
+ FullIdentifier: stringPointer("mojom.test.Foo"),
DeclaredOrdinal: -1,
DeclarationOrder: -1,
SourceFileInfo: &mojom_types.SourceFileInfo{
« no previous file with comments | « mojom/mojom_parser/serialization/serialization.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698