Put the '*' in the right place in the unit test. Forgot to fix up this

bit of style, sorry.

llvm-svn: 146733
This commit is contained in:
Chandler Carruth 2011-12-16 09:37:55 +00:00
parent 2fd51946ee
commit fd1f79871a
1 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@ namespace {
// Defines a variadic function StringCat() to join strings. // Defines a variadic function StringCat() to join strings.
// StringCat()'s arguments and return value have class types. // StringCat()'s arguments and return value have class types.
std::string StringCatImpl(ArrayRef<const std::string*> Args) { std::string StringCatImpl(ArrayRef<const std::string *> Args) {
std::string S; std::string S;
for (unsigned i = 0, e = Args.size(); i < e; ++i) for (unsigned i = 0, e = Args.size(); i < e; ++i)
S += *Args[i]; S += *Args[i];
@ -39,7 +39,7 @@ TEST(VariadicFunctionTest, WorksForClassTypes) {
// have primitive types. // have primitive types.
// The return type of SumImp() is deliberately different from its // The return type of SumImp() is deliberately different from its
// argument type, as we want to test that this works. // argument type, as we want to test that this works.
long SumImpl(ArrayRef<const int*> Args) { long SumImpl(ArrayRef<const int *> Args) {
long Result = 0; long Result = 0;
for (unsigned i = 0, e = Args.size(); i < e; ++i) for (unsigned i = 0, e = Args.size(); i < e; ++i)
Result += *Args[i]; Result += *Args[i];
@ -56,7 +56,7 @@ TEST(VariadicFunctionTest, WorksForPrimitiveTypes) {
// Appends an array of strings to dest and returns the number of // Appends an array of strings to dest and returns the number of
// characters appended. // characters appended.
int StringAppendImpl(std::string* Dest, ArrayRef<const std::string*> Args) { int StringAppendImpl(std::string *Dest, ArrayRef<const std::string *> Args) {
int Chars = 0; int Chars = 0;
for (unsigned i = 0, e = Args.size(); i < e; ++i) { for (unsigned i = 0, e = Args.size(); i < e; ++i) {
Chars += Args[i]->size(); Chars += Args[i]->size();
@ -64,7 +64,7 @@ int StringAppendImpl(std::string* Dest, ArrayRef<const std::string*> Args) {
} }
return Chars; return Chars;
} }
const VariadicFunction1<int, std::string*, std::string, const VariadicFunction1<int, std::string *, std::string,
StringAppendImpl> StringAppend; StringAppendImpl> StringAppend;
TEST(VariadicFunction1Test, Works) { TEST(VariadicFunction1Test, Works) {
@ -85,14 +85,14 @@ TEST(VariadicFunction1Test, Works) {
// Counts how many optional arguments fall in the given range. // Counts how many optional arguments fall in the given range.
// Returns the result in *num_in_range. We make the return type void // Returns the result in *num_in_range. We make the return type void
// as we want to test that VariadicFunction* can handle it. // as we want to test that VariadicFunction* can handle it.
void CountInRangeImpl(int* NumInRange, int Low, int High, void CountInRangeImpl(int *NumInRange, int Low, int High,
ArrayRef<const int*> Args) { ArrayRef<const int *> Args) {
*NumInRange = 0; *NumInRange = 0;
for (unsigned i = 0, e = Args.size(); i < e; ++i) for (unsigned i = 0, e = Args.size(); i < e; ++i)
if (Low <= *Args[i] && *Args[i] <= High) if (Low <= *Args[i] && *Args[i] <= High)
++(*NumInRange); ++(*NumInRange);
} }
const VariadicFunction3<void, int*, int, int, int, const VariadicFunction3<void, int *, int, int, int,
CountInRangeImpl> CountInRange; CountInRangeImpl> CountInRange;
TEST(VariadicFunction3Test, Works) { TEST(VariadicFunction3Test, Works) {