Commit 99b5c0c9 by alokp@chromium.org

Fixed compile errors and warnings on linux.

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1088 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2c958eef
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstring>
namespace pp namespace pp
{ {
......
...@@ -44,14 +44,14 @@ TEST(InputTest, DefaultConstructor) ...@@ -44,14 +44,14 @@ TEST(InputTest, DefaultConstructor)
TEST(InputTest, NullLength) TEST(InputTest, NullLength)
{ {
char* str[] = {"foo"}; const char* 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"}; const char* 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"}; const char* 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"}; const char* 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"}; const char* 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"}; const char* 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"}; const char* 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};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment