forked from OSchip/llvm-project
Improved tests (and fixed a bug in the tests); thanks to Richard Smith for the suggestion
llvm-svn: 186022
This commit is contained in:
parent
b34939aaf5
commit
48c9fe29b2
|
@ -23,7 +23,11 @@ int main()
|
|||
assert ( std::exchange ( v, 23 ) == 12 );
|
||||
assert ( v == 23 );
|
||||
assert ( std::exchange ( v, 67.2 ) == 23 );
|
||||
assert ( v = 67 );
|
||||
assert ( v == 67 );
|
||||
|
||||
assert ((std::exchange<int, float> ( v, {} )) == 67 );
|
||||
assert ( v == 0 );
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -40,8 +44,15 @@ int main()
|
|||
assert ( s3 == s2 );
|
||||
assert ( std::exchange ( s3, "Hi Mom!" ) == s2 );
|
||||
assert ( s3 == s1 );
|
||||
assert ( std::exchange ( s3, "" ) == s1 );
|
||||
|
||||
s3 = s2; // Dad
|
||||
assert ( std::exchange ( s3, {} ) == s2 );
|
||||
assert ( s3.size () == 0 );
|
||||
|
||||
s3 = s2; // Dad
|
||||
assert ( std::exchange ( s3, "" ) == s2 );
|
||||
assert ( s3.size () == 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue