|
@@ -0,0 +1,124 @@
|
|
|
+// s2 -- replace many sHT_test_hidden
|
|
|
+// Copyright (C) 2018 Ariadne Devos
|
|
|
+//
|
|
|
+// This program is free software: you can redistribute it and/or modify
|
|
|
+// it under the terms of the GNU General Public License as published by
|
|
|
+// the Free Software Foundation, either version 3 of the License, or
|
|
|
+// (at your option) any later version.
|
|
|
+//
|
|
|
+// This program is distributed in the hope that it will be useful,
|
|
|
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
+// GNU General Public License for more details.
|
|
|
+//
|
|
|
+// You should have received a copy of the GNU General Public License
|
|
|
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
+
|
|
|
+@ test_self @
|
|
|
+expression e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e)
|
|
|
++ sHT_nonzero_p(e)
|
|
|
+
|
|
|
+@ test_nonzero @
|
|
|
+expression e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e != 0)
|
|
|
++ sHT_nonzero_p(e)
|
|
|
+
|
|
|
+@ test_zero @
|
|
|
+expression e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e == 0)
|
|
|
++ sHT_zero_p(e)
|
|
|
+
|
|
|
+@ test_null @
|
|
|
+expression e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e == NULL)
|
|
|
++ sHT_null_p(e)
|
|
|
+
|
|
|
+@ test_lt0 @
|
|
|
+int e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e < 0)
|
|
|
++ sHT_lt0(e)
|
|
|
+
|
|
|
+@ test_ge0 @
|
|
|
+expression e;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e >= 0)
|
|
|
++ !sHT_lt0(e)
|
|
|
+
|
|
|
+@ test_ge1 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e >= f)
|
|
|
++ sHT_ge(e, f)
|
|
|
+
|
|
|
+@ test_ge2 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden2(e, f, e >= f)
|
|
|
++ sHT_ge(e, f)
|
|
|
+
|
|
|
+@ test_gt1 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e > f)
|
|
|
++ sHT_gt(e, f)
|
|
|
+
|
|
|
+@ test_gt2 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden2(e, f, e > f)
|
|
|
++ sHT_gt(e, f)
|
|
|
+
|
|
|
+@ test_lt1 @
|
|
|
+expression e, f != 0;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(\(e\|f\), e < f)
|
|
|
++ sHT_gt(f, e)
|
|
|
+
|
|
|
+@ test_lt2 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden2(e, f, e < f)
|
|
|
++ sHT_gt(f, e)
|
|
|
+
|
|
|
+@ test_and1_not @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, !(e & f))
|
|
|
++ !sHT_and_any(e, f)
|
|
|
+
|
|
|
+@ test_and2_not @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden2(e, ..., !(e & f))
|
|
|
++ !sHT_and_any(e, f)
|
|
|
+
|
|
|
+@ test_and1 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden(e, e & f)
|
|
|
++ sHT_and_any(e, f)
|
|
|
+
|
|
|
+@ test_and2 @
|
|
|
+expression e, f;
|
|
|
+@@
|
|
|
+- sHT_test_hidden2(e, ..., e & f)
|
|
|
++ sHT_and_any(e, f)
|
|
|
+
|
|
|
+@ has_tests @
|
|
|
+@@
|
|
|
+ \(sHT_gt\|sHT_ge\|sHT_lt0\|sHT_null_p\|sHT_zero_p\|sHT_nonzero_p\|sHT_and_any\)
|
|
|
+
|
|
|
+@ test_header @
|
|
|
+@@
|
|
|
+ #include <sHT/test.h>
|
|
|
+
|
|
|
+@ introduce_test_header depends on has_tests && !test_header @
|
|
|
+@@
|
|
|
+ #include <sHT/compiler.h>
|
|
|
++ #include <sHT/test.h>
|