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

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

Issue 1915413002: Mojom frontend: Detect Ill-founded Types (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix comments as per code review. Created 4 years, 8 months 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_tool/parser/parse_driver.go ('k') | mojom/mojom_tool/utils/wellfounded_graphs.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_tool/serialization/serialization_test.go
diff --git a/mojom/mojom_tool/serialization/serialization_test.go b/mojom/mojom_tool/serialization/serialization_test.go
index cce8a1d666aa2afc4b147edaefb7e7d536a1ff9b..545609c748bd181c16eb1ee275164f8ad201df0c 100644
--- a/mojom/mojom_tool/serialization/serialization_test.go
+++ b/mojom/mojom_tool/serialization/serialization_test.go
@@ -1148,6 +1148,10 @@ func TestSingleFileSerialization(t *testing.T) {
t.Errorf("ComputeFinalData error for %s: %s", c.fileName, err.Error())
continue
}
+ if err := descriptor.DetectIllFoundedTypes(); err != nil {
+ t.Errorf("DetectIllFoundedTypes error for %s: %s", c.fileName, err.Error())
+ continue
+ }
// Simulate setting the canonical file name for the imported files. In real operation
// this step is done in parser_driver.go when each of the imported files are parsed.
@@ -2082,7 +2086,7 @@ func TestWithComputedData(t *testing.T) {
struct MyStruct1 {
int8 x;
MyUnion1 my_union;
- MyStruct1 my_struct;
+ MyStruct1? my_struct;
MyInterface1& my_interface_request;
int32 y;
MyInterface1 my_interface;
@@ -2117,7 +2121,7 @@ func TestWithComputedData(t *testing.T) {
{
DeclData: test.newShortDeclDataO(2, -1, "my_struct"),
Type: &mojom_types.TypeTypeReference{mojom_types.TypeReference{
- false, false, stringPointer("MyStruct1"), stringPointer("TYPE_KEY:MyStruct1")}},
+ true, false, stringPointer("MyStruct1"), stringPointer("TYPE_KEY:MyStruct1")}},
Offset: 24,
},
// field my_interface_request
@@ -2181,7 +2185,7 @@ func TestWithComputedData(t *testing.T) {
struct MyStruct1 {
int8 x;
MyUnion1 my_union;
- MyStruct1 my_struct;
+ MyStruct1? my_struct;
[MinVersion=1]
MyInterface1&? my_interface_request;
@@ -2222,7 +2226,7 @@ func TestWithComputedData(t *testing.T) {
{
DeclData: test.newShortDeclDataO(2, -1, "my_struct"),
Type: &mojom_types.TypeTypeReference{mojom_types.TypeReference{
- false, false, stringPointer("MyStruct1"), stringPointer("TYPE_KEY:MyStruct1")}},
+ true, false, stringPointer("MyStruct1"), stringPointer("TYPE_KEY:MyStruct1")}},
Offset: 24,
},
// field my_interface_request
@@ -2303,6 +2307,10 @@ func TestWithComputedData(t *testing.T) {
t.Errorf("ComputeFinalData error for %s: %s", c.fileName, err.Error())
continue
}
+ if err := descriptor.DetectIllFoundedTypes(); err != nil {
+ t.Errorf("DetectIllFoundedTypes error for %s: %s", c.fileName, err.Error())
+ continue
+ }
// Simulate setting the canonical file name for the imported files. In real operation
// this step is done in parser_driver.go when each of the imported files are parsed.
@@ -2412,6 +2420,10 @@ func TestMetaDataOnlyMode(t *testing.T) {
t.Errorf("ComputeFinalData error for %s: %s", c.fileName, err.Error())
continue
}
+ if err := descriptor.DetectIllFoundedTypes(); err != nil {
+ t.Errorf("DetectIllFoundedTypes error for %s: %s", c.fileName, err.Error())
+ continue
+ }
// Serialize
bytes, _, err := serialize(descriptor, false, false, c.lineAndcolumnNumbers, false)
@@ -2687,6 +2699,10 @@ func TestTwoFileSerialization(t *testing.T) {
t.Errorf("ComputeFinalData error for case %d: %s", i, err.Error())
continue
}
+ if err := descriptor.DetectIllFoundedTypes(); err != nil {
+ t.Errorf("DetectIllFoundedTypes error for case %d: %s", i, err.Error())
+ continue
+ }
// Serialize
bytes, _, err := serialize(descriptor, false, false, c.lineAndcolumnNumbers, false)
@@ -3296,6 +3312,10 @@ func TestRuntimeTypeInfo(t *testing.T) {
t.Errorf("ComputeFinalData error for case %d: %s", i, err.Error())
continue
}
+ if err := descriptor.DetectIllFoundedTypes(); err != nil {
+ t.Errorf("DetectIllFoundedTypes error for case %d: %s", i, err.Error())
+ continue
+ }
// Serialize
bytes, _, err := serialize(descriptor, false, false, false, true)
« no previous file with comments | « mojom/mojom_tool/parser/parse_driver.go ('k') | mojom/mojom_tool/utils/wellfounded_graphs.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698