[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests d2dcc15 112/316: Move tests in c
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests d2dcc15 112/316: Move tests in cedet/semantic |
Date: |
Sat, 28 Jan 2017 09:09:52 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit d2dcc15e6476f848e87d901a03e50b2bb0805b87
Author: xscript <address@hidden>
Commit: Edward John Steere <address@hidden>
Move tests in cedet/semantic
---
.../cedet/cedet/semantic/tests/testsppcond.cpp | 227 ++++++++++++++++++++
1 file changed, 227 insertions(+)
diff --git a/test/manual/cedet/cedet/semantic/tests/testsppcond.cpp
b/test/manual/cedet/cedet/semantic/tests/testsppcond.cpp
new file mode 100644
index 0000000..310a526
--- /dev/null
+++ b/test/manual/cedet/cedet/semantic/tests/testsppcond.cpp
@@ -0,0 +1,227 @@
+/** testsppcond.cpp --- Test CPP Conditional handling via hideif
+ *
+ * Copyright (C) 2010 Eric M. Ludlam
+ *
+ * Author: Eric M. Ludlam <address@hidden>
+ * X-RCS: $Id: testsppcond.cpp,v 1.1 2010-01-23 02:36:28 zappo Exp $
+ *
+ * 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 2, 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; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/*
+ * DEVELOPER NOTES:
+ *
+ * When working in this file, enable semantic-decoration-mode, and
+ * always create small functions. In this case, it will overline
+ * everything labeled PASS, and nothing labeled FAIL. This makes it
+ * easy to see what the result will be without running the unit test.
+ */
+
+#define TRUE 1
+#define FALSE 0
+#define TRUE1 TRUE
+#define FALSE1 FALSE
+#define TRUE2 TRUE1
+
+#define THREE 3
+
+#define JUSTDEFINED
+#define UNDEFINED
+#undef UNDEFINED
+
+#undef UNDEFUNDEFINED
+
+// *** TEST SOME IFDEFS
+
+// This could fail if FALSE was interpreted as false, not defined.
+#ifdef FALSE
+int pass_ifdef1() {}
+#else
+int fail_ifdef1() {}
+#endif
+
+#ifdef TRUE
+int pass_ifdef2() {}
+#else
+int fail_ifdef2() {}
+#endif
+
+// This fails if JUSTDEFINED was interpreted as false
+#ifdef JUSTDEFINED
+int pass_ifdef3() {}
+#else
+int fail_ifdef3() {}
+#endif
+
+#ifdef NOTDEFINED
+int fail_ifdef4() {}
+#else
+int pass_ifdef4() {}
+#endif
+
+#ifdef UNDEFINED
+int fail_ifdef5() {}
+#else
+int pass_ifdef5() {}
+#endif
+
+// *** TEST SOME if defined() cases.
+#if defined(FALSE)
+int pass_if_def1() {}
+#else
+int fail_if_def1() {}
+#endif
+
+#if defined(TRUE)
+int pass_if_def2() {}
+#else
+int fail_if_def2() {}
+#endif
+
+#if defined(JUSTDEFINED)
+int pass_if_def3() {}
+#else
+int fail_if_def3() {}
+#endif
+
+#if defined(NOTDEFINED)
+int fail_if_def4() {}
+#else
+int pass_if_def4() {}
+#endif
+
+#if defined(UNDEFINED)
+int fail_if_def5() {}
+#else
+int pass_if_def5() {}
+#endif
+
+// *** TEST if evaluations to 0/1
+
+#if TRUE
+int pass_true() {}
+#else
+int fail_true() {}
+#endif
+
+#if TRUE1
+int pass_true1() {}
+#else
+int fail_true1() {}
+#endif
+
+#if TRUE2
+int pass_true2() {}
+#else
+int fail_true2() {}
+#endif
+
+#if FALSE
+int fail_false() {}
+#else
+int pass_false() {}
+#endif
+
+#if FALSE1
+int fail_false1() {}
+#else
+int pass_false1() {}
+#endif
+
+// *** TEST some if comparisons.
+#if TRUE == TRUE1
+int pass_eq_true1() {}
+#else
+int fail_eq_true1() {}
+#endif
+
+#if TRUE == TRUE2
+int pass_eq_true2() {}
+#else
+int fail_eq_true2() {}
+#endif
+
+#if FALSE == FALSE1
+int pass_eq_false1() {}
+#else
+int fail_eq_false1() {}
+#endif
+
+#if TRUE != FALSE
+int pass_neq() {}
+#else
+int fail_neq() {}
+#endif
+
+// *** TEST simple math.
+#if TRUE+TRUE==2
+int pass_true_2() {}
+#else
+int fail_true_2() {}
+#endif
+
+#if TRUE+TRUE-FALSE==2
+int pass_true_false_2() {}
+#else
+int fail_true_false_2() {}
+#endif
+
+#if TRUE+TRUE==3
+int fail_true_n3() {}
+#else
+int pass_true_n3() {}
+#endif
+
+// *** TEST boolean &&
+#if defined(FALSE) && TRUE
+int pass_and1() {}
+#else
+int fail_and1() {}
+#endif
+
+#if defined(FALSE) && TRUE && TRUE+FALSE==1
+int pass_and2() {}
+#else
+int fail_and2() {}
+#endif
+
+#if defined(TRUE) && FALSE && TRUE+FALSE==1
+int fail_and3() {}
+#else
+int pass_and3() {}
+#endif
+
+// *** TEST boolean ||
+#if defined(FALSE) || TRUE
+int pass_or1() {}
+#else
+int fail_or1() {}
+#endif
+
+#if defined(FALSE) || TRUE || TRUE+FALSE==1
+int pass_or2() {}
+#else
+int fail_or2() {}
+#endif
+
+#if defined(TRUE) || FALSE || TRUE+FALSE==1
+int pass_or3() {}
+#else
+int fail_or3() {}
+#endif
+
+
+/* END */
- [Emacs-diffs] scratch/merge-cedet-tests 19ad5c7 095/316: Merge from 1.0pre6 branch, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 19ad5c7 095/316: Merge from 1.0pre6 branch, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 690c256 092/316: ("Lisp"): Add :versionsource, and :aux-packages, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 96526d7 096/316: (Lisp): Add cit-uml.el (Misc): Add cit-uml.cgr, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 68ea5e3 098/316: (Lisp): Use preload compiler., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests f300a36 100/316: (Lisp): Add cit-symref.el., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 007464d 104/316: (cit/Lisp): Add cit-projvar.el, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a6f2191 103/316: (Lisp): Add cit-arduino, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 302b4d7 107/316: eieio: Move to obsolete and use the one that ships with Emacs, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ee352df 113/316: How to use the cit-test.sh script., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests f91e2ce 114/316: New pretend system include for cpproot test., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests d2dcc15 112/316: Move tests in cedet/semantic,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 34041d4 120/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests d08bd3b 117/316: C/C++: Fix function pointer parsing, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 3a7b458 110/316: Fixes for security tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ceb9293 130/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6d9366a 135/316: Make 'this' a pointer., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests fb82965 136/316: Test `this' from in inline member functions, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 64c305b 137/316: Test files contributed by Barry OReilly, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests c132878 122/316: Make unit tests use randomized file names, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 0897a28 127/316: Test file for Project.ede proj., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests f3a937b 143/316: Test project file., Edward John Steere, 2017/01/28