[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests fd40e7f 212/316: Move tests in c
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests fd40e7f 212/316: Move tests in cedet/semantic |
Date: |
Sat, 28 Jan 2017 09:10:02 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit fd40e7f4c9d38737d495002d615d76056932cef5
Author: xscript <address@hidden>
Commit: Edward John Steere <address@hidden>
Move tests in cedet/semantic
---
test/manual/cedet/cedet/semantic/tests/test.c | 222 +++++++++++++++++++++++++
1 file changed, 222 insertions(+)
diff --git a/test/manual/cedet/cedet/semantic/tests/test.c
b/test/manual/cedet/cedet/semantic/tests/test.c
new file mode 100644
index 0000000..449dfe1
--- /dev/null
+++ b/test/manual/cedet/cedet/semantic/tests/test.c
@@ -0,0 +1,222 @@
+/* Test file for C language.
+ * Attempt to include as many aspects of the C language as possible.
+ *
+ * $Id: test.c,v 1.12 2008-05-17 20:16:03 zappo Exp $
+ *
+ */
+/* types of include files */
+#include "includeme1.h"
+#include <includeme2.h>
+#include <subdir/includeme3.h>
+#include <includeme.notanhfile>
+#include <stdlib.h>
+#include <cmath>
+
+#if 0
+int dont_show_function()
+{
+}
+#endif
+
+/* Global types */
+struct mystruct1 {
+ int slot11;
+ char slot12;
+ float slot13;
+};
+
+struct mystruct2 {
+ int slot21;
+ char slot22;
+ float slot23;
+} var_of_type_mystruct2;
+
+struct {
+ int slot31;
+ char slot32;
+ float slot33;
+} var_of_anonymous_struct;
+
+typedef struct mystruct1 typedef_of_mystruct1;
+typedef struct mystruct1 *typedef_of_pointer_mystruct1;
+typedef struct { int slot_a; } typedef_of_anonymous_struct;
+typedef struct A {
+} B;
+
+typedef struct mystruct1 td1, td2;
+
+union myunion1 {
+ int slot41;
+ char slot42;
+ float slot43;
+};
+
+union myunion2 {
+ int slot51;
+ char slot52;
+ float slot53;
+} var_of_type_myunion2;
+
+struct {
+ int slot61;
+ char slot72;
+ float slot83;
+} var_of_anonymous_union;
+
+typedef union myunion1 typedef_of_myunion1;
+typedef union myunion1 *typedef_of_pointer_myunion1;
+typedef union { int slot_a; } typedef_of_anonymous_union;
+
+enum myenum1 { enum11 = 1, enum12 };
+enum myenum2 { enum21, enum22 = 2 } var_of_type_myenum2;
+enum { enum31, enum32 } var_of_anonymous_enum;
+
+typedef enum myenum1 typedef_of_myenum1;
+typedef enum myenum1 *typedef_of_pointer_myenum1;
+typedef enum { enum_a = 3, enum_b } typedef_of_anonymous_enum;
+
+typedef int typedef_of_int;
+
+/* Here are some simpler variable types */
+int var1;
+int varbit1:1;
+char var2;
+float var3;
+mystruct1 var3;
+struct mystruct1 var4;
+union myunion1 var5;
+enum myenum1 var6;
+
+char *varp1;
+char **varp2;
+char varv1[1];
+char varv2[1][2];
+
+char *varpa1 = "moose";
+struct mystruct2 vara2 = { 1, 'a', 0.0 };
+enum myenum1 vara3 = enum11;
+int vara4 = (int)0.0;
+int vara5 = funcall();
+
+int mvar1, mvar2, mvar3;
+char *mvarp1, *mvarp2, *mvarp3;
+char *mvarpa1 = 'a', *mvarpa2 = 'b', *mvarpa3 = 'c';
+char mvaras1[10], mvaras2[12][13], *mvaras3 = 'd';
+
+static register const unsigned int tmvar1;
+
+#define MACRO1 1
+#define MACRO2(foo) (1+foo)
+
+/* Here are some function prototypes */
+
+/* This is legal, but I decided not to support inferred integer
+ * types on functions and variables.
+ */
+fun0();
+int funp1();
+char funp2(int arg11);
+float funp3(char arg21, char arg22);
+struct mystrct1 funp4(struct mystruct2 arg31, union myunion2 arg32);
+enum myenum1 funp5(char *arg41, union myunion1 *arg42);
+
+char funpp1 __P(char argp1, struct mystruct2 argp2, char *arg4p);
+
+int fun1();
+
+/* Here is a function pointer */
+int (*funcptr)(int a, int b);
+
+/* Function Definitions */
+
+/* This is legal, but I decided not to support inferred integer
+ * types on functions and variables.
+ */
+fun0()
+{
+ int sv = 0;
+}
+
+int fun1 ()
+{
+ int sv = 1;
+}
+
+int fun1p1 (void)
+{
+ int sv = 1;
+}
+
+char fun2(int arg_11)
+{
+ char sv = 2;
+}
+
+float fun3(char arg_21, char arg_22)
+{
+ char sv = 3;
+}
+
+struct mystrct1 fun4(struct mystruct2 arg31, union myunion2 arg32)
+{
+ sv = 4;
+}
+
+enum myenum1 fun5(char *arg41, union myunion1 *arg42)
+{
+ sv = 5;
+}
+
+/* Functions with K&R syntax. */
+struct mystrct1 funk1(arg_31, arg_32)
+ struct mystruct2 arg_31;
+ union myunion2 arg32;
+{
+ sv = 4;
+}
+
+enum myenum1 *funk2(arg_41, arg_42)
+ char *arg_41;
+ union myunion1 *arg_42;
+{
+ sv = 5;
+
+ if(foo) {
+ }
+}
+
+int funk3(arg_51, arg_53)
+ int arg_51;
+ char arg_53;
+{
+ char q = 'a';
+ int sv = 6;
+ td1 ms1;
+ enum myenum1 testconst;
+
+ /* Function argument analysis */
+ funk3(ms1.slot11, arg_53 );
+ sv = 7;
+
+ /* Slot deref on assignee */
+ ms1.slot11 = s;
+
+ /* Enum/const completion */
+ testconst = e;
+
+ /* Bad var/slot and param */
+ blah.notafunction(moose);
+
+ /* Print something. */
+ printf("Moose", );
+
+ tan();
+}
+
+int funk4_fixme(arg_61, arg_62)
+ int arg_61, arg_62;
+{
+
+}
+
+/* End of C tests */
- [Emacs-diffs] scratch/merge-cedet-tests 38d59cb 207/316: Tests: Add ERT test for the C Bovinator, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 38d59cb 207/316: Tests: Add ERT test for the C Bovinator, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 4bf5287 199/316: Fix interactive unit tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 784b5c8 231/316: Make unit tests use randomized file names, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests df0e0e6 193/316: Synchronize cedet/srecode with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 2316f19 173/316: Add whitespace at the end of a filled buffer, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 7177e01 210/316: Add compdb EDE project, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests e076b36 177/316: Set the auto-add-method to always during test, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b85662e 218/316: New file, derived from logging functions in cedet-utest.el, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b6ebafc 233/316: Added more test data, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 49b4ce7 213/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests fd40e7f 212/316: Move tests in cedet/semantic,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 99ad7b6 206/316: Added security test, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 404d4da 242/316: Improve compilation active detection, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 727bca8 248/316: Ensure that the correct buffer is active when, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 42516a8 254/316: Added cpproot tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9767368 308/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 83bcf53 274/316: (cit-srecode-fill-el): Insert classes before methods., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 1373a94 285/316: (cit-gnu-externaldb-test-one): Improve test for bad search result., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 816e083 151/316: (ede-detect-utest-project-list): Add test for generic VC type project. (ede-detect-utest): Add fake autoloader for VC. (ede-detect-utest-generic-vc-p): New., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests e9c9716 279/316: Fixes for external db tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests e0d3d7b 303/316: New tests., Edward John Steere, 2017/01/28