Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
6d4d2f06
Unverified
Commit
6d4d2f06
authored
Feb 20, 2019
by
Gennadiy Civil
Committed by
GitHub
Feb 20, 2019
Browse files
Merge pull request #2141 from dspinellis/index-fix
Avoid array index out of range
parents
d850e144
9dc235b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
googletest/docs/primer.md
googletest/docs/primer.md
+1
-1
No files found.
googletest/docs/primer.md
View file @
6d4d2f06
...
@@ -122,7 +122,7 @@ To provide a custom failure message, simply stream it into the macro using the
...
@@ -122,7 +122,7 @@ To provide a custom failure message, simply stream it into the macro using the
```
c++
```
c++
ASSERT_EQ
(
x
.
size
(),
y
.
size
())
<<
"Vectors x and y are of unequal length"
;
ASSERT_EQ
(
x
.
size
(),
y
.
size
())
<<
"Vectors x and y are of unequal length"
;
for
(
int
i
=
0
;
i
<
x
.
size
(
);
++
i
)
{
for
(
int
i
=
0
;
i
<
std
::
min
(
x
.
size
(),
y
.
size
()
);
++
i
)
{
EXPECT_EQ
(
x
[
i
],
y
[
i
])
<<
"Vectors x and y differ at index "
<<
i
;
EXPECT_EQ
(
x
[
i
],
y
[
i
])
<<
"Vectors x and y differ at index "
<<
i
;
}
}
```
```
...
...
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