Skip to content

Commit 0d39900

Browse files
author
Bret Ambrose
committed
Updated copyright on new files, added multiple value input and output tests to SimpleStringStream
1 parent de0bdf0 commit 0d39900

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

aws-cpp-sdk-core-tests/utils/memory/SimpleStringStreamTests.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,33 @@ TEST(SimpleStringStreamTest, BasicOutput)
4040

4141
ASSERT_STREQ(ss.str().c_str(), SIMPLE_STRING);
4242
}
43+
44+
TEST(SimpleStringStreamTest, MultipleOutput)
45+
{
46+
Aws::SimpleStringStream ss;
47+
48+
ss << "A string " << Aws::String("\"Howdy\"");
49+
ss << ", a number " << 75;
50+
ss << ", and a boolean " << std::boolalpha << true;
51+
ss << " walk into a bar";
52+
53+
ASSERT_STREQ(ss.str().c_str(), "A string \"Howdy\", a number 75, and a boolean true walk into a bar");
54+
}
55+
56+
TEST(SimpleStringStreamTest, MultipleInput)
57+
{
58+
Aws::SimpleStringStream ss("523 47.0 true");
59+
60+
uint32_t number = 0;
61+
ss >> number;
62+
ASSERT_TRUE(number == 523);
63+
64+
double fp = 0.0;
65+
ss >> fp;
66+
ASSERT_DOUBLE_EQ(fp, 47.0);
67+
68+
bool value = false;
69+
ss >> std::boolalpha >> value;
70+
ASSERT_TRUE(value);
71+
}
72+

aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSStringStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aws-cpp-sdk-core/include/aws/core/utils/stream/SimpleStreamBuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License").
66
* You may not use this file except in compliance with the License.

aws-cpp-sdk-core/source/utils/memory/stl/SimpleStringStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License").
66
* You may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)