Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
fadc2058
Commit
fadc2058
authored
Jun 28, 2012
by
alokp@chromium.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More expression tests for division by zero.
git-svn-id:
https://angleproject.googlecode.com/svn/trunk@1171
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
c6b3b3c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
if_test.cpp
tests/preprocessor_tests/if_test.cpp
+28
-0
No files found.
tests/preprocessor_tests/if_test.cpp
View file @
fadc2058
...
@@ -620,6 +620,34 @@ TEST_F(IfTest, MissingExpression)
...
@@ -620,6 +620,34 @@ TEST_F(IfTest, MissingExpression)
mPreprocessor
.
lex
(
&
token
);
mPreprocessor
.
lex
(
&
token
);
}
}
TEST_F
(
IfTest
,
DivisionByZero
)
{
const
char
*
str
=
"#if 1 / (3 - (1 + 2))
\n
"
"#endif
\n
"
;
ASSERT_TRUE
(
mPreprocessor
.
init
(
1
,
&
str
,
0
));
EXPECT_CALL
(
mDiagnostics
,
print
(
pp
::
Diagnostics
::
DIVISION_BY_ZERO
,
pp
::
SourceLocation
(
0
,
1
),
"1 / 0"
));
pp
::
Token
token
;
mPreprocessor
.
lex
(
&
token
);
}
TEST_F
(
IfTest
,
ModuloByZero
)
{
const
char
*
str
=
"#if 1 % (3 - (1 + 2))
\n
"
"#endif
\n
"
;
ASSERT_TRUE
(
mPreprocessor
.
init
(
1
,
&
str
,
0
));
EXPECT_CALL
(
mDiagnostics
,
print
(
pp
::
Diagnostics
::
DIVISION_BY_ZERO
,
pp
::
SourceLocation
(
0
,
1
),
"1 % 0"
));
pp
::
Token
token
;
mPreprocessor
.
lex
(
&
token
);
}
TEST_F
(
IfTest
,
UndefinedMacro
)
TEST_F
(
IfTest
,
UndefinedMacro
)
{
{
const
char
*
str
=
"#if UNDEFINED
\n
"
const
char
*
str
=
"#if UNDEFINED
\n
"
...
...
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