mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-05 17:30:27 +00:00
Use the right append in test
std::string doesn't have an append(char)
This commit is contained in:
parent
a8dcc1a71d
commit
38896c2ecd
1 changed files with 3 additions and 3 deletions
|
@ -361,19 +361,19 @@ main()
|
||||||
// tests the small-string optimization on ctl::string
|
// tests the small-string optimization on ctl::string
|
||||||
char* d = s.data();
|
char* d = s.data();
|
||||||
for (int i = 0; i < 23; ++i) {
|
for (int i = 0; i < 23; ++i) {
|
||||||
s.append('a');
|
s.append("a");
|
||||||
if (s.data() != d) {
|
if (s.data() != d) {
|
||||||
return 79 + i;
|
return 79 + i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.append('a');
|
s.append("a");
|
||||||
if (s.data() == d) {
|
if (s.data() == d) {
|
||||||
return 103;
|
return 103;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// just check that append in a loop works
|
// just check that append in a loop works
|
||||||
for (int i = 0; i < 24; ++i) {
|
for (int i = 0; i < 24; ++i) {
|
||||||
s.append('a');
|
s.append("a");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s != "aaaaaaaaaaaaaaaaaaaaaaaa") {
|
if (s != "aaaaaaaaaaaaaaaaaaaaaaaa") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue