[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 0e41dab 116/316: Move tests in c
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 0e41dab 116/316: Move tests in cedet/semantic |
Date: |
Sat, 28 Jan 2017 09:09:53 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 0e41dabe6f8742a18815d29e953134d5c0ef2b7a
Author: xscript <address@hidden>
Commit: Edward John Steere <address@hidden>
Move tests in cedet/semantic
---
.../cedet/cedet/semantic/tests/testsppreplace.c | 161 ++++++++++++++++++++
1 file changed, 161 insertions(+)
diff --git a/test/manual/cedet/cedet/semantic/tests/testsppreplace.c
b/test/manual/cedet/cedet/semantic/tests/testsppreplace.c
new file mode 100644
index 0000000..757a53c
--- /dev/null
+++ b/test/manual/cedet/cedet/semantic/tests/testsppreplace.c
@@ -0,0 +1,161 @@
+/* Test CPP/SPP Replacement
+ */
+
+/* TEST: The EMU keyword doesn't screw up the function defn. */
+#define EMU
+#define EMU2 /*comment*/
+char EMU parse_around_emu EMU2 (EMU)
+{
+}
+
+/* TEST: A simple word can be replaced in a definition. */
+#define SUBFLOAT /* Some Float */ float
+SUBFLOAT returnanfloat()
+{
+}
+
+/* TEST: Punctuation an be replaced in a definition. */
+#define COLON :
+int foo COLON COLON bar ()
+{
+}
+
+/* TEST: Multiple lexical characters in a definition */
+#define SUPER mysuper::
+int SUPER baz ()
+{
+}
+
+/* TEST: Macro replacement. */
+#define INT_FCN(name) int name (int in)
+
+INT_FCN(increment) {
+ return in+1;
+}
+
+/* TEST: Macro replacement with complex args */
+#define P_(proto) ()
+
+int myFcn1 P_((a,b));
+
+#define P__(proto) proto
+
+int myFcn2 P__((int a, int b));
+int myFcn3 (int a, int b);
+
+/* TEST: Macro replacement for very long argument lists. (See xdisp.c in
Emacs) */
+int myFcn4 P__((int a,
+ int b,
+ int c,
+ int d,
+ int e,
+ int f));
+
+/* TEST: Multiple args to a macro. */
+#define MULTI_ARGS(name, field1, field2, field3) struct name { int field1; int
field2; int field3; }
+
+MULTI_ARGS(ma_struct, moose, penguin, emu);
+
+/* TEST: Macro w/ args, but no body. */
+#define NO_BODY(name)
+
+NO_BODY(Moose);
+
+/* TEST: Not a macro with args, but close. */
+#define NOT_WITH_ARGS (moose)
+
+int not_with_args_fcn NOT_WITH_ARGS
+{
+}
+
+/* TEST: macro w/ continuation. */
+#define WITH_CONT \
+ continuation_symbol
+
+int WITH_CONT () { };
+
+/* TEST: macros in a macro - tail processing */
+#define tail_with_args_and_long_name(a) (int a)
+#define int_arg tail_with_args_and_long_name
+
+int tail int_arg(q) {}
+
+/* TEST: macros used improperly. */
+#define tail_fail tail_with_args_and_long_name(q)
+
+int tail_fcn tail_fail(q);
+
+/* TEST: feature of CPP from LSD <address@hidden> */
+#define __gthrw_(name) __gthrw_ ## name
+
+int __gthrw_(foo) (int arg1) { }
+
+/* TEST: macros using macros */
+#define macro_foo foo
+#define mf_declare int macro_foo
+
+mf_declare;
+
+/* TEST: macros with args using macros */
+#define Amacro(A) (int A)
+#define mf_Amacro(B) int B Amacro(B)
+
+mf_Amacro(noodle);
+
+/* TEST: Double macro using the argument stack. */
+#define MACRO0(name) int that_ ## name(int i);
+#define MACRO1(name) int this_ ## name(int i);
+#define MACRO2(name) MACRO0(name) MACRO1(name)
+
+MACRO2(foo)
+
+/* TEST: The G++ namespace macro hack. Not really part of SPP. */
+_GLIBCXX_BEGIN_NAMESPACE(baz)
+
+ int bazfnc(int b) { }
+
+_GLIBCXX_END_NAMESPACE;
+
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(foo,bar)
+
+ int foo_bar_func(int a) { }
+
+_GLIBCXX_END_NESTED_NAMESPACE;
+
+
+/* TEST: The VC++ macro hack. */
+_STD_BEGIN
+
+ int inside_std_namespace(int a) { }
+
+_STD_END
+
+/* TEST: Recursion prevention. CPP doesn't allow even 1 level of recursion. */
+#define STARTMACRO MACROA
+#define MACROA MACROB
+#define MACROB MACROA
+
+int STARTMACRO () {
+
+}
+
+/* TEST: Fancy concat/recursive macros */
+#define CONCAT(x,y) x##y
+#define PASTE(x,y) CONCAT(x,y)
+#define OBJ(fn) PASTE(PREFIX, fn)
+#define PREFIX PASTE(A,B)
+
+int
+OBJ(test) /* expands to ABtest */
+ ;
+
+/* TEST: Macro Recursion limits in arguments to a macro.
+ * This code is from ALSA (with names changed to moose), noticed by Yupeng. */
+#define mr_moose(n) list_entry(n, struct mr_moose, list)
+
+struct mr_moose_ops {
+ int (*mr_moose_disconnect)(struct mr_moose *dev);
+};
+
+
+/* END */
- [Emacs-diffs] scratch/merge-cedet-tests af4eb43 149/316: Additions to generic project testing, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests af4eb43 149/316: Additions to generic project testing, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 614a6bb 044/316: Synchronize base 'cedet/ede' with Emacs, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a375d40 093/316: ("cit"): Give it a new name. (Misc): New target., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b0da906 144/316: New unit test for EDE project detection., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9c2d002 145/316: Added cpproot and java root to detection tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 47c4081 165/316: sample lib srces for dirmatch tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ef840da 159/316: compdb: add project detection tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 8c4e7fd 111/316: Added arduino and better suggestions, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6945c33 126/316: Expand preprocessor to handle macros which open or close scope., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 89526ab 134/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 0e41dab 116/316: Move tests in cedet/semantic,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 8ba639f 150/316: (ede-detect-utest-project-list): Add jvm-base projects for ant, lein, maven, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 284144e 154/316: Fixes for test execution, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests fa54ec1 162/316: (isFooLike, A, B, main2): New test tweaked from example by Liang Wang, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests cebc72c 228/316: Make unit tests use randomized file names, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 7fce11d 056/316: Uniquafy names from last example from Martin to include ms_ prefix., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 779f839 032/316: (LOADPATH): Add speedbar. (EMACSFLAGS): New variable (Lisp): Use above., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 1c4ec31 045/316: Add test for parsing local variables, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 05006be 049/316: Semantic Symref testing., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests c2fada4 230/316: Force srecode repo location and add decorations to debug output, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests f916b8f 125/316: C/C++: Fix function pointer parsing, Edward John Steere, 2017/01/28