diff options
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests/resources')
8 files changed, 52 insertions, 31 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp index 986e6c031db..f6cb5823fd8 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/After.cpp @@ -4,28 +4,28 @@ struct x { struct x getX() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171520 -int bug=sizeof(int); +int bug = sizeof(int); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=173837 class ABaseClass { protected: ABaseClass(int x); }; -class AClass : public ABaseClass { +class AClass: public ABaseClass { AClass(int x) throw(int); void test1() const throw(int); void test2() throw(); }; AClass::AClass(int x) throw(int) : ABaseClass(x) { - for (int i=0; i < 12; i++) { + for (int i = 0; i < 12; i++) { } } // keep space between decl spec and declarator int main(int argc, char **argv) { } // handling of string concat -char* s1= "this " "is " "one " "string."; -char* s2= "this " "is " +char* s1 = "this " "is " "one " "string."; +char* s2 = "this " "is " "one " "string."; // macro definition with line comment #define ID(x) x // identity @@ -34,7 +34,7 @@ int main() { } // semicolons inside for void g() { - for (int i=0; i<10; ++i) { + for (int i = 0; i < 10; ++i) { } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=183220 @@ -43,18 +43,17 @@ void bug183220() { rtc_s2000_src_pending, rtc_s2000_cr_sync_pending, rtc_hdw_cr_sync_next, rtc_hdw_current_clock; int rtc_s2000_clock_source_state, RTC_CLOCK_PLL; - if (( ( rtc_hdw_cr_sync_next != rtc_hdw_cr_sync ) - || rtc_hdw_cr_resync_enable )&& !rtc_s2000_src_pending - && !rtc_s2000_cr_sync_pending) { + if (((rtc_hdw_cr_sync_next != rtc_hdw_cr_sync) || rtc_hdw_cr_resync_enable) + && !rtc_s2000_src_pending && !rtc_s2000_cr_sync_pending) { if (!identify_hdw_fvr_master() || !rtc_hdw_current_clock->external - || !rtc_hdw_cr_sync_next ||( ( rtc_hdw_current_clock->external + || !rtc_hdw_cr_sync_next || ((rtc_hdw_current_clock->external && rtc_hdw_cr_sync_next && rtc_s2000_clock_source_state - != RTC_CLOCK_PLL ) )) { + != RTC_CLOCK_PLL))) { } } } // declaration with array initializer -long dummy[]= { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, +long dummy[] = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp index 30437af2f4b..70ba3bdacac 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/bugs/Before.cpp @@ -9,16 +9,16 @@ class AClass : public ABaseClass {AClass(int x) throw(int); void test1() const t AClass::AClass(int x)throw(int):ABaseClass(x){for (int i=0;i < 12;i++) {}} // keep space between decl spec and declarator int -main(int argc, char **argv) {} +main(int argc,char **argv) {} // handling of string concat char* s1= "this " "is " "one ""string."; char* s2= "this " "is " "one " "string."; // macro definition with line comment #define ID(x) x // identity -int main() {return ID(0);} +int main(){return ID(0);} // semicolons inside for -void g() {for(int i=0;i<10;++i){}} +void g(){for(int i=0;i<10;++i){}} // https://bugs.eclipse.org/bugs/show_bug.cgi?id=183220 void bug183220() { diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp index 1d1714954f9..07d43c21b4d 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp @@ -44,11 +44,11 @@ int foo(int bar) const { /* * Line Wrapping */ -int array[]= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000, - 2000, 3000, 4000, 5000 }; -int compare(int argument, int otherArgument) { - return argument+otherArgument > argument*otherArgument+1000000 ? 100000 - +50000 : 200000-30000; +int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 1000, 2000, 3000, 4000, 5000 }; +int compare(int argument, int otherArg) { + return argument + otherArg > argument * otherArg + 1000000 ? 100000 + 50000 + : 200000 - 30000; } class Other { static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, @@ -59,3 +59,21 @@ void foo() { Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000); } +enum EEEE { + ONE, + TWO, + THREE, + FOUR, + FIVE, + SIX, + SEVEN = 7, + EIGHT, + NINE, + TEN, + HUNDRED, + THOUSAND, + AMILLION +}; +template<typename T1, typename T2> class map { +}; +map<int, int> m; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp index 97138157acc..461ecc0a9cc 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/Before.cpp @@ -7,6 +7,8 @@ class Point {public:Point(double xc, double yc) : x(xc), y(yc) {}double distance * Line Wrapping */ int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000, 2000, 3000, 4000, 5000}; -int compare(int argument, int otherArgument) {return argument+otherArgument > argument*otherArgument+1000000 ? 100000+50000 : 200000-30000;} +int compare(int argument, int otherArg) {return argument+otherArg > argument*otherArg+1000000 ? 100000+50000 : 200000-30000;} class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}}; void foo() {Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000);} +enum EEEE{ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN=7,EIGHT,NINE,TEN,HUNDRED,THOUSAND,AMILLION}; +template<typename T1,typename T2> class map {};map<int,int> m; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp index da4d8fe71ee..89ede2db0a6 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/After.cpp @@ -4,7 +4,7 @@ struct SimpleStruct { int num; - char name[ ]; + char name[]; float floatNum; }; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp index 772cee09500..5a012a8591d 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/sample/Before.cpp @@ -5,7 +5,7 @@ struct SimpleStruct { int num; - char name[ ]; + char name [ ]; float floatNum; }; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp index 1fcaa2a11cd..e82c29c4db3 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/After.cpp @@ -11,7 +11,8 @@ class Foo { }; // TEMPLATE_STRUCT -template<class Key, class Value, class SortAlgorithm=DefaultSort> struct Map { +template<class Key, class Value, class SortAlgorithm=DefaultSort> +struct Map { Key* keys; Value* values; SortAlgorithm* sortAlgorithm; @@ -25,7 +26,7 @@ private: public: nonVector() { - head =new T(); + head = new T(); } int length() { return 1; @@ -34,7 +35,8 @@ public: }; // TEMPLATE_UNION -template<class X, class Y, int size=16> union ArrayOverlay { +template<class X, class Y, int size=16> +union ArrayOverlay { public: X x[size]; Y y[size]; @@ -46,7 +48,8 @@ public: class TemplateContainer { // these are in an enclosing class template<class Bar> void fum(int i); - template<int> void scrum(void) { + template<int> + void scrum(void) { } ; }; @@ -62,12 +65,11 @@ template<class Bar> void Foo::fum(int i) { } // TEMPLATE_VARIABLES -template <bool threads, int inst> char +template<bool threads, int inst> char * default_alloc_template<threads, inst>::S_start_free = 0; // an instantiation, not a template: -complex -<float> cf(0, 0); +complex<float> cf(0, 0); //template<class Language, class CharacterSet, class SortAlgorithm<CharacterSet> > //Dictionary* TheSpellCheckDictionary; diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp index 6873eca767e..09696f13e9a 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/templates/Before.cpp @@ -25,7 +25,7 @@ template<class T> class nonVector { private: T* head; public: - nonVector() {head =new T();} + nonVector() {head=new T();} int length() {return 1;} const T& first() const; }; |