mirror of
https://github.com/boostorg/utility.git
synced 2025-08-03 06:44:37 +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(!(y != y));
|
||||||
|
|
||||||
assert((z || !z) == indeterminate);
|
assert((z || !z) == indeterminate);
|
||||||
assert(!(z == true));
|
assert(indeterminate(z == true));
|
||||||
assert(!(true == z));
|
assert(indeterminate(true == z));
|
||||||
assert(!(z == false));
|
assert(indeterminate(z == false));
|
||||||
assert(!(false == z));
|
assert(indeterminate(false == z));
|
||||||
assert(z == indeterminate);
|
assert(z == indeterminate);
|
||||||
assert(indeterminate == z);
|
assert(indeterminate == z);
|
||||||
assert(!(z != indeterminate));
|
assert(!(z != indeterminate));
|
||||||
@@ -89,6 +89,16 @@ int main()
|
|||||||
assert(indeterminate(x || indeterminate));
|
assert(indeterminate(x || indeterminate));
|
||||||
assert(indeterminate(indeterminate || x));
|
assert(indeterminate(indeterminate || x));
|
||||||
|
|
||||||
|
if (z) {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
else if (!z) {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assert(true);
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "no errors detected\n";
|
std::cout << "no errors detected\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user