mirror of
https://github.com/boostorg/utility.git
synced 2025-08-02 14:24:30 +02:00
tribool_test.cpp:
- Test the if (x)...else if (!x)...else syntax - Fix a few broken testcases :( [SVN r350]
This commit is contained in:
@@ -52,10 +52,10 @@ int main()
|
||||
assert(!(y != y));
|
||||
|
||||
assert((z || !z) == indeterminate);
|
||||
assert(!(z == true));
|
||||
assert(!(true == z));
|
||||
assert(!(z == false));
|
||||
assert(!(false == z));
|
||||
assert(indeterminate(z == true));
|
||||
assert(indeterminate(true == z));
|
||||
assert(indeterminate(z == false));
|
||||
assert(indeterminate(false == z));
|
||||
assert(z == indeterminate);
|
||||
assert(indeterminate == z);
|
||||
assert(!(z != indeterminate));
|
||||
@@ -89,6 +89,16 @@ int main()
|
||||
assert(indeterminate(x || indeterminate));
|
||||
assert(indeterminate(indeterminate || x));
|
||||
|
||||
if (z) {
|
||||
assert(false);
|
||||
}
|
||||
else if (!z) {
|
||||
assert(false);
|
||||
}
|
||||
else {
|
||||
assert(true);
|
||||
}
|
||||
|
||||
std::cout << "no errors detected\n";
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user