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
99b5c0c9
Commit
99b5c0c9
authored
May 17, 2012
by
alokp@chromium.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compile errors and warnings on linux.
git-svn-id:
https://angleproject.googlecode.com/svn/trunk@1088
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
2c958eef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Input.cpp
src/compiler/preprocessor/new/Input.cpp
+1
-0
input_test.cpp
tests/preprocessor_tests/input_test.cpp
+7
-7
No files found.
src/compiler/preprocessor/new/Input.cpp
View file @
99b5c0c9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <algorithm>
#include <algorithm>
#include <cassert>
#include <cassert>
#include <cstring>
namespace
pp
namespace
pp
{
{
...
...
tests/preprocessor_tests/input_test.cpp
View file @
99b5c0c9
...
@@ -44,14 +44,14 @@ TEST(InputTest, DefaultConstructor)
...
@@ -44,14 +44,14 @@ TEST(InputTest, DefaultConstructor)
TEST
(
InputTest
,
NullLength
)
TEST
(
InputTest
,
NullLength
)
{
{
char
*
str
[]
=
{
"foo"
};
c
onst
c
har
*
str
[]
=
{
"foo"
};
pp
::
Input
input
(
1
,
str
,
NULL
);
pp
::
Input
input
(
1
,
str
,
NULL
);
EXPECT_EQ
(
3
,
input
.
length
(
0
));
EXPECT_EQ
(
3
,
input
.
length
(
0
));
}
}
TEST
(
InputTest
,
NegativeLength
)
TEST
(
InputTest
,
NegativeLength
)
{
{
char
*
str
[]
=
{
"foo"
};
c
onst
c
har
*
str
[]
=
{
"foo"
};
int
length
[]
=
{
-
1
};
int
length
[]
=
{
-
1
};
pp
::
Input
input
(
1
,
str
,
length
);
pp
::
Input
input
(
1
,
str
,
length
);
EXPECT_EQ
(
3
,
input
.
length
(
0
));
EXPECT_EQ
(
3
,
input
.
length
(
0
));
...
@@ -59,7 +59,7 @@ TEST(InputTest, NegativeLength)
...
@@ -59,7 +59,7 @@ TEST(InputTest, NegativeLength)
TEST
(
InputTest
,
ActualLength
)
TEST
(
InputTest
,
ActualLength
)
{
{
char
*
str
[]
=
{
"foobar"
};
c
onst
c
har
*
str
[]
=
{
"foobar"
};
int
length
[]
=
{
3
};
int
length
[]
=
{
3
};
pp
::
Input
input
(
1
,
str
,
length
);
pp
::
Input
input
(
1
,
str
,
length
);
// Note that strlen(str[0]) != length[0].
// Note that strlen(str[0]) != length[0].
...
@@ -69,7 +69,7 @@ TEST(InputTest, ActualLength)
...
@@ -69,7 +69,7 @@ TEST(InputTest, ActualLength)
TEST
(
InputTest
,
String
)
TEST
(
InputTest
,
String
)
{
{
char
*
str
[]
=
{
"foo"
};
c
onst
c
har
*
str
[]
=
{
"foo"
};
pp
::
Input
input
(
1
,
str
,
NULL
);
pp
::
Input
input
(
1
,
str
,
NULL
);
EXPECT_STREQ
(
str
[
0
],
input
.
string
(
0
));
EXPECT_STREQ
(
str
[
0
],
input
.
string
(
0
));
}
}
...
@@ -77,7 +77,7 @@ TEST(InputTest, String)
...
@@ -77,7 +77,7 @@ TEST(InputTest, String)
TEST
(
InputTest
,
ReadSingleString
)
TEST
(
InputTest
,
ReadSingleString
)
{
{
int
count
=
1
;
int
count
=
1
;
char
*
str
[]
=
{
"foo"
};
c
onst
c
har
*
str
[]
=
{
"foo"
};
char
buf
[
4
]
=
{
'\0'
,
'\0'
,
'\0'
,
'\0'
};
char
buf
[
4
]
=
{
'\0'
,
'\0'
,
'\0'
,
'\0'
};
int
maxSize
=
1
;
int
maxSize
=
1
;
...
@@ -114,7 +114,7 @@ TEST(InputTest, ReadSingleString)
...
@@ -114,7 +114,7 @@ TEST(InputTest, ReadSingleString)
TEST
(
InputTest
,
ReadMultipleStrings
)
TEST
(
InputTest
,
ReadMultipleStrings
)
{
{
int
count
=
3
;
int
count
=
3
;
char
*
str
[]
=
{
"f"
,
"o"
,
"o"
};
c
onst
c
har
*
str
[]
=
{
"f"
,
"o"
,
"o"
};
char
buf
[
4
]
=
{
'\0'
,
'\0'
,
'\0'
,
'\0'
};
char
buf
[
4
]
=
{
'\0'
,
'\0'
,
'\0'
,
'\0'
};
int
maxSize
=
1
;
int
maxSize
=
1
;
...
@@ -151,7 +151,7 @@ TEST(InputTest, ReadMultipleStrings)
...
@@ -151,7 +151,7 @@ TEST(InputTest, ReadMultipleStrings)
TEST
(
InputTest
,
ReadStringsWithLength
)
TEST
(
InputTest
,
ReadStringsWithLength
)
{
{
int
count
=
2
;
int
count
=
2
;
char
*
str
[]
=
{
"foo"
,
"bar"
};
c
onst
c
har
*
str
[]
=
{
"foo"
,
"bar"
};
// Note that the length for the first string is 2 which is less than
// Note that the length for the first string is 2 which is less than
// strlen(str[0]. We want to make sure that the last character is ignored.
// strlen(str[0]. We want to make sure that the last character is ignored.
int
length
[]
=
{
2
,
3
};
int
length
[]
=
{
2
,
3
};
...
...
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