Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ed645d07
Unverified
Commit
ed645d07
authored
Feb 10, 2017
by
Derek McQuay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated docs in roundtrip.go to correct names
parent
8fcbd569
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
roundtrip.go
staging/src/k8s.io/apimachinery/pkg/api/testing/roundtrip.go
+3
-3
No files found.
staging/src/k8s.io/apimachinery/pkg/api/testing/roundtrip.go
View file @
ed645d07
...
@@ -40,7 +40,7 @@ import (
...
@@ -40,7 +40,7 @@ import (
var
FuzzIters
=
flag
.
Int
(
"fuzz-iters"
,
20
,
"How many fuzzing iterations to do."
)
var
FuzzIters
=
flag
.
Int
(
"fuzz-iters"
,
20
,
"How many fuzzing iterations to do."
)
//
n
onRoundTrippableTypes are kinds that are effectively reserved across all GroupVersions
//
globalN
onRoundTrippableTypes are kinds that are effectively reserved across all GroupVersions
// They don't roundtrip
// They don't roundtrip
var
globalNonRoundTrippableTypes
=
sets
.
NewString
(
var
globalNonRoundTrippableTypes
=
sets
.
NewString
(
"ExportOptions"
,
"ExportOptions"
,
...
@@ -56,7 +56,7 @@ var globalNonRoundTrippableTypes = sets.NewString(
...
@@ -56,7 +56,7 @@ var globalNonRoundTrippableTypes = sets.NewString(
"DeleteOptions"
,
"DeleteOptions"
,
)
)
// RoundTripTypes applies the round-trip test to all round-trippable Kinds
// RoundTripTypes
WithoutProtobuf
applies the round-trip test to all round-trippable Kinds
// in the scheme. It will skip all the GroupVersionKinds in the skip list.
// in the scheme. It will skip all the GroupVersionKinds in the skip list.
func
RoundTripTypesWithoutProtobuf
(
t
*
testing
.
T
,
scheme
*
runtime
.
Scheme
,
codecFactory
runtimeserializer
.
CodecFactory
,
fuzzer
*
fuzz
.
Fuzzer
,
nonRoundTrippableTypes
map
[
schema
.
GroupVersionKind
]
bool
)
{
func
RoundTripTypesWithoutProtobuf
(
t
*
testing
.
T
,
scheme
*
runtime
.
Scheme
,
codecFactory
runtimeserializer
.
CodecFactory
,
fuzzer
*
fuzz
.
Fuzzer
,
nonRoundTrippableTypes
map
[
schema
.
GroupVersionKind
]
bool
)
{
roundTripTypes
(
t
,
scheme
,
codecFactory
,
fuzzer
,
nonRoundTrippableTypes
,
true
)
roundTripTypes
(
t
,
scheme
,
codecFactory
,
fuzzer
,
nonRoundTrippableTypes
,
true
)
...
@@ -214,7 +214,7 @@ func roundTrip(t *testing.T, scheme *runtime.Scheme, codec runtime.Codec, object
...
@@ -214,7 +214,7 @@ func roundTrip(t *testing.T, scheme *runtime.Scheme, codec runtime.Codec, object
// ensure that the object produced from decoding the encoded data is equal
// ensure that the object produced from decoding the encoded data is equal
// to the original object
// to the original object
if
!
apiequality
.
Semantic
.
DeepEqual
(
original
,
obj2
)
{
if
!
apiequality
.
Semantic
.
DeepEqual
(
original
,
obj2
)
{
t
.
Errorf
(
"
\n
1: %v: diff: %v
\n
Codec: %#v
\n
Source:
\n\n
%#v
\n\n
Encoded:
\n\n
%s
\n\n
Final:
\n\n
%#v"
,
name
,
diff
.
ObjectReflectDiff
(
object
,
obj2
),
codec
,
printer
.
Sprintf
(
"%#v"
,
object
),
dataAsString
(
data
),
printer
.
Sprintf
(
"%#v"
,
obj2
))
t
.
Errorf
(
"1: %v: diff: %v
\n
Codec: %#v
\n
Source:
\n\n
%#v
\n\n
Encoded:
\n\n
%s
\n\n
Final:
\n\n
%#v"
,
name
,
diff
.
ObjectReflectDiff
(
object
,
obj2
),
codec
,
printer
.
Sprintf
(
"%#v"
,
object
),
dataAsString
(
data
),
printer
.
Sprintf
(
"%#v"
,
obj2
))
return
return
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment