diff options
| author | ruki <[email protected]> | 2025-11-09 19:51:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-09 19:51:04 +0800 |
| commit | 91f6ed08fe32e36d555129efa4afdd82113f0eb4 (patch) | |
| tree | 2bfee23488c8479c83833677262ee83b9e362cbb /tests/projects/c++ | |
| parent | c89c94bf89e98c8e42e786aacc0b334a57474179 (diff) | |
format tests and templates
Diffstat (limited to 'tests/projects/c++')
78 files changed, 163 insertions, 191 deletions
diff --git a/tests/projects/c++/console_zig_cxx/src/main.cpp b/tests/projects/c++/console_zig_cxx/src/main.cpp index 7c435d251..55d2f380a 100644 --- a/tests/projects/c++/console_zig_cxx/src/main.cpp +++ b/tests/projects/c++/console_zig_cxx/src/main.cpp @@ -2,8 +2,7 @@ using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { cout << "hello world!" << endl; return 0; } diff --git a/tests/projects/c++/doctest/src/main.cpp b/tests/projects/c++/doctest/src/main.cpp index 7c435d251..55d2f380a 100644 --- a/tests/projects/c++/doctest/src/main.cpp +++ b/tests/projects/c++/doctest/src/main.cpp @@ -2,8 +2,7 @@ using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { cout << "hello world!" << endl; return 0; } diff --git a/tests/projects/c++/manifest/src/main.cpp b/tests/projects/c++/manifest/src/main.cpp index db2361659..55d2f380a 100644 --- a/tests/projects/c++/manifest/src/main.cpp +++ b/tests/projects/c++/manifest/src/main.cpp @@ -2,8 +2,7 @@ using namespace std; -int main(int argc, char** argv) -{ - cout << "hello world!" << endl; +int main(int argc, char **argv) { + cout << "hello world!" << endl; return 0; } diff --git a/tests/projects/c++/modules/class/src/hello_impl.cpp b/tests/projects/c++/modules/class/src/hello_impl.cpp index 5dd555a7a..b09f4b96c 100644 --- a/tests/projects/c++/modules/class/src/hello_impl.cpp +++ b/tests/projects/c++/modules/class/src/hello_impl.cpp @@ -5,10 +5,9 @@ module hello; using namespace std; namespace hello { - say::say(int data) : data_(data) { - - } - void say::hello() { - cout << "hello, say class: " << data_ << endl; - } +say::say(int data) : data_(data) { +} +void say::hello() { + cout << "hello, say class: " << data_ << endl; } +} // namespace hello diff --git a/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp b/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp index 5dd555a7a..b09f4b96c 100644 --- a/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp +++ b/tests/projects/c++/modules/class_cmake/src/hello_impl.cpp @@ -5,10 +5,9 @@ module hello; using namespace std; namespace hello { - say::say(int data) : data_(data) { - - } - void say::hello() { - cout << "hello, say class: " << data_ << endl; - } +say::say(int data) : data_(data) { +} +void say::hello() { + cout << "hello, say class: " << data_ << endl; } +} // namespace hello diff --git a/tests/projects/c++/modules/class_cmake/src/main.cpp b/tests/projects/c++/modules/class_cmake/src/main.cpp index b96807bda..87b8b92f7 100644 --- a/tests/projects/c++/modules/class_cmake/src/main.cpp +++ b/tests/projects/c++/modules/class_cmake/src/main.cpp @@ -1,7 +1,7 @@ import hello; int main() { - hello::say s(sizeof(hello::say)); - s.hello(); - return 0; + hello::say s(sizeof(hello::say)); + s.hello(); + return 0; } diff --git a/tests/projects/c++/modules/dependence/src/hello_impl.cpp b/tests/projects/c++/modules/dependence/src/hello_impl.cpp index 064afebad..b7f9baaa3 100644 --- a/tests/projects/c++/modules/dependence/src/hello_impl.cpp +++ b/tests/projects/c++/modules/dependence/src/hello_impl.cpp @@ -5,19 +5,20 @@ module hello; import mod; void inner() { - std::cout << "hello world! data: " - << mod::foo() << std::endl; + std::cout << "hello world! data: " << mod::foo() << std::endl; } namespace hello { - int data__; - void say_hello() { ::inner(); } +int data__; +void say_hello() { + ::inner(); +} - say::say(int data) : data_{data} { - } +say::say(int data) : data_{ data } { +} - void say::hello() { - hello::data__ = data_; - ::inner(); - } +void say::hello() { + hello::data__ = data_; + ::inner(); } +} // namespace hello diff --git a/tests/projects/c++/modules/dependence/src/main.cpp b/tests/projects/c++/modules/dependence/src/main.cpp index 93cc427a4..470c69ebc 100644 --- a/tests/projects/c++/modules/dependence/src/main.cpp +++ b/tests/projects/c++/modules/dependence/src/main.cpp @@ -6,4 +6,3 @@ int main() { hello::say(sizeof(hello::say)).hello(); return 0; } - diff --git a/tests/projects/c++/modules/dependence/src/mod_impl.cpp b/tests/projects/c++/modules/dependence/src/mod_impl.cpp index 1adf6570e..aabac7648 100644 --- a/tests/projects/c++/modules/dependence/src/mod_impl.cpp +++ b/tests/projects/c++/modules/dependence/src/mod_impl.cpp @@ -2,7 +2,7 @@ module mod; import hello; namespace mod { - int foo() { - return hello::data__; - } +int foo() { + return hello::data__; } +} // namespace mod diff --git a/tests/projects/c++/modules/dependence2/src/main.cpp b/tests/projects/c++/modules/dependence2/src/main.cpp index b5c04f1b2..a74024e11 100644 --- a/tests/projects/c++/modules/dependence2/src/main.cpp +++ b/tests/projects/c++/modules/dependence2/src/main.cpp @@ -7,4 +7,3 @@ int main() { printf("sub(1, 2): %d\n", foo::sub(1, 2)); return 0; } - diff --git a/tests/projects/c++/modules/dependency_flag_update2/src/main.cpp b/tests/projects/c++/modules/dependency_flag_update2/src/main.cpp index d34cba080..8629450ac 100644 --- a/tests/projects/c++/modules/dependency_flag_update2/src/main.cpp +++ b/tests/projects/c++/modules/dependency_flag_update2/src/main.cpp @@ -1,6 +1,6 @@ import foobar; int main() { - hello(); - return 0; + hello(); + return 0; } diff --git a/tests/projects/c++/modules/headerunits_person/src/test.cpp b/tests/projects/c++/modules/headerunits_person/src/test.cpp index d12206ef7..17a7fb34d 100644 --- a/tests/projects/c++/modules/headerunits_person/src/test.cpp +++ b/tests/projects/c++/modules/headerunits_person/src/test.cpp @@ -1,11 +1,10 @@ import person;
import <iostream>;
-import <string>; // For operator<< for std::string
+import <string>; // For operator<< for std::string
using namespace std;
-int main()
-{
+int main() {
Person person{ "Kole", "Webb" };
cout << person.getLastName() << ", " << person.getFirstName() << endl;
}
diff --git a/tests/projects/c++/modules/hide_dependency_flags/src/main.cpp b/tests/projects/c++/modules/hide_dependency_flags/src/main.cpp index 1d385dcfa..a3447b492 100644 --- a/tests/projects/c++/modules/hide_dependency_flags/src/main.cpp +++ b/tests/projects/c++/modules/hide_dependency_flags/src/main.cpp @@ -2,9 +2,8 @@ import foo; -int main(int argc, char** argv) { +int main(int argc, char **argv) { printf("add(1, 2): %d\n", foo::add(1, 2)); printf("sub(1, 2): %d\n", foo::sub(1, 2)); return 0; } - diff --git a/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp index eccfed5d3..fa17673ab 100644 --- a/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp +++ b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp @@ -5,15 +5,15 @@ module hello; using namespace std; namespace hello { - void say_hi() { - cout << "hello hi!" << endl; - } +void say_hi() { + cout << "hello hi!" << endl; +} - void say_hello() { - cout << "hello world!" << endl; - } +void say_hello() { + cout << "hello world!" << endl; +} - void say_xz() { - cout << "hello xz!" << endl; - } +void say_xz() { + cout << "hello xz!" << endl; } +} // namespace hello diff --git a/tests/projects/c++/modules/moduleonly_private_dep/src/main.cpp b/tests/projects/c++/modules/moduleonly_private_dep/src/main.cpp index 0fdfc6d11..1ad0c5d8e 100644 --- a/tests/projects/c++/modules/moduleonly_private_dep/src/main.cpp +++ b/tests/projects/c++/modules/moduleonly_private_dep/src/main.cpp @@ -1,5 +1,5 @@ import B; int main() { - return func(); + return func(); } diff --git a/tests/projects/c++/modules/moduleonly_private_dep/src/modB.cpp b/tests/projects/c++/modules/moduleonly_private_dep/src/modB.cpp index 6e7a8de49..fb3c7a97a 100644 --- a/tests/projects/c++/modules/moduleonly_private_dep/src/modB.cpp +++ b/tests/projects/c++/modules/moduleonly_private_dep/src/modB.cpp @@ -3,5 +3,5 @@ module B; import A; int func() { - return foo; + return foo; } diff --git a/tests/projects/c++/modules/namespace/src/hello_impl.cpp b/tests/projects/c++/modules/namespace/src/hello_impl.cpp index 064afebad..b7f9baaa3 100644 --- a/tests/projects/c++/modules/namespace/src/hello_impl.cpp +++ b/tests/projects/c++/modules/namespace/src/hello_impl.cpp @@ -5,19 +5,20 @@ module hello; import mod; void inner() { - std::cout << "hello world! data: " - << mod::foo() << std::endl; + std::cout << "hello world! data: " << mod::foo() << std::endl; } namespace hello { - int data__; - void say_hello() { ::inner(); } +int data__; +void say_hello() { + ::inner(); +} - say::say(int data) : data_{data} { - } +say::say(int data) : data_{ data } { +} - void say::hello() { - hello::data__ = data_; - ::inner(); - } +void say::hello() { + hello::data__ = data_; + ::inner(); } +} // namespace hello diff --git a/tests/projects/c++/modules/namespace/src/main.cpp b/tests/projects/c++/modules/namespace/src/main.cpp index 93cc427a4..470c69ebc 100644 --- a/tests/projects/c++/modules/namespace/src/main.cpp +++ b/tests/projects/c++/modules/namespace/src/main.cpp @@ -6,4 +6,3 @@ int main() { hello::say(sizeof(hello::say)).hello(); return 0; } - diff --git a/tests/projects/c++/modules/namespace/src/mod_impl.cpp b/tests/projects/c++/modules/namespace/src/mod_impl.cpp index 1adf6570e..aabac7648 100644 --- a/tests/projects/c++/modules/namespace/src/mod_impl.cpp +++ b/tests/projects/c++/modules/namespace/src/mod_impl.cpp @@ -2,7 +2,7 @@ module mod; import hello; namespace mod { - int foo() { - return hello::data__; - } +int foo() { + return hello::data__; } +} // namespace mod diff --git a/tests/projects/c++/modules/namespace2/src/hello_impl.cpp b/tests/projects/c++/modules/namespace2/src/hello_impl.cpp index 064afebad..b7f9baaa3 100644 --- a/tests/projects/c++/modules/namespace2/src/hello_impl.cpp +++ b/tests/projects/c++/modules/namespace2/src/hello_impl.cpp @@ -5,19 +5,20 @@ module hello; import mod; void inner() { - std::cout << "hello world! data: " - << mod::foo() << std::endl; + std::cout << "hello world! data: " << mod::foo() << std::endl; } namespace hello { - int data__; - void say_hello() { ::inner(); } +int data__; +void say_hello() { + ::inner(); +} - say::say(int data) : data_{data} { - } +say::say(int data) : data_{ data } { +} - void say::hello() { - hello::data__ = data_; - ::inner(); - } +void say::hello() { + hello::data__ = data_; + ::inner(); } +} // namespace hello diff --git a/tests/projects/c++/modules/namespace2/src/main.cpp b/tests/projects/c++/modules/namespace2/src/main.cpp index 93cc427a4..470c69ebc 100644 --- a/tests/projects/c++/modules/namespace2/src/main.cpp +++ b/tests/projects/c++/modules/namespace2/src/main.cpp @@ -6,4 +6,3 @@ int main() { hello::say(sizeof(hello::say)).hello(); return 0; } - diff --git a/tests/projects/c++/modules/namespace2/src/mod_impl.cpp b/tests/projects/c++/modules/namespace2/src/mod_impl.cpp index 1adf6570e..aabac7648 100644 --- a/tests/projects/c++/modules/namespace2/src/mod_impl.cpp +++ b/tests/projects/c++/modules/namespace2/src/mod_impl.cpp @@ -2,7 +2,7 @@ module mod; import hello; namespace mod { - int foo() { - return hello::data__; - } +int foo() { + return hello::data__; } +} // namespace mod diff --git a/tests/projects/c++/modules/packages-subtarget/my-repo/packages/f/foo/src/foo.cpp b/tests/projects/c++/modules/packages-subtarget/my-repo/packages/f/foo/src/foo.cpp index e5565a01a..22b4cec59 100644 --- a/tests/projects/c++/modules/packages-subtarget/my-repo/packages/f/foo/src/foo.cpp +++ b/tests/projects/c++/modules/packages-subtarget/my-repo/packages/f/foo/src/foo.cpp @@ -1,6 +1,6 @@ module foo; namespace foo { - void say(const char *msg) { - } +void say(const char *msg) { } +} // namespace foo diff --git a/tests/projects/c++/modules/packages/my-repo/packages/f/foo/src/foo.cpp b/tests/projects/c++/modules/packages/my-repo/packages/f/foo/src/foo.cpp index e5565a01a..22b4cec59 100644 --- a/tests/projects/c++/modules/packages/my-repo/packages/f/foo/src/foo.cpp +++ b/tests/projects/c++/modules/packages/my-repo/packages/f/foo/src/foo.cpp @@ -1,6 +1,6 @@ module foo; namespace foo { - void say(const char *msg) { - } +void say(const char *msg) { } +} // namespace foo diff --git a/tests/projects/c++/modules/partitions/src/main.cpp b/tests/projects/c++/modules/partitions/src/main.cpp index 058dfd522..898d28058 100644 --- a/tests/projects/c++/modules/partitions/src/main.cpp +++ b/tests/projects/c++/modules/partitions/src/main.cpp @@ -3,7 +3,6 @@ import math; int main() { - std::cout << std::endl; std::cout << "add(3, 4): " << add(3, 4) << std::endl; diff --git a/tests/projects/c++/modules/partitions_implunit/src/foo.cpp b/tests/projects/c++/modules/partitions_implunit/src/foo.cpp index cc4c0c3fe..85fcc3b63 100644 --- a/tests/projects/c++/modules/partitions_implunit/src/foo.cpp +++ b/tests/projects/c++/modules/partitions_implunit/src/foo.cpp @@ -3,4 +3,6 @@ module Foo; // Impl is implictly imported here
-void foo() { bar(); }
+void foo() {
+ bar();
+}
diff --git a/tests/projects/c++/modules/partitions_implunit/src/main.cpp b/tests/projects/c++/modules/partitions_implunit/src/main.cpp index acef780c2..9d38b891e 100644 --- a/tests/projects/c++/modules/partitions_implunit/src/main.cpp +++ b/tests/projects/c++/modules/partitions_implunit/src/main.cpp @@ -1,6 +1,6 @@ import Foo;
-int main(int argc, char** argv) {
+int main(int argc, char **argv) {
foo();
return 0;
}
diff --git a/tests/projects/c++/modules/partitions_implunit2/src/main.cpp b/tests/projects/c++/modules/partitions_implunit2/src/main.cpp index acef780c2..9d38b891e 100644 --- a/tests/projects/c++/modules/partitions_implunit2/src/main.cpp +++ b/tests/projects/c++/modules/partitions_implunit2/src/main.cpp @@ -1,6 +1,6 @@ import Foo;
-int main(int argc, char** argv) {
+int main(int argc, char **argv) {
foo();
return 0;
}
diff --git a/tests/projects/c++/modules/phony/src/hello.cpp b/tests/projects/c++/modules/phony/src/hello.cpp index 38ecf20e3..fe5943e3c 100644 --- a/tests/projects/c++/modules/phony/src/hello.cpp +++ b/tests/projects/c++/modules/phony/src/hello.cpp @@ -7,11 +7,10 @@ module hello; using namespace std; namespace hello { - say::say(int data) : data_(data) { - - } +say::say(int data) : data_(data) { +} - void say::hello() { - cout << "hello, say class: " << data_ << endl; - } +void say::hello() { + cout << "hello, say class: " << data_ << endl; +} } // namespace hello diff --git a/tests/projects/c++/modules/phony2/include/foo.h b/tests/projects/c++/modules/phony2/include/foo.h index e66099202..025d24b7c 100644 --- a/tests/projects/c++/modules/phony2/include/foo.h +++ b/tests/projects/c++/modules/phony2/include/foo.h @@ -1 +1,3 @@ -inline int foo() { return 5; } +inline int foo() { + return 5; +} diff --git a/tests/projects/c++/modules/phony2/src/hello.cpp b/tests/projects/c++/modules/phony2/src/hello.cpp index 38ecf20e3..fe5943e3c 100644 --- a/tests/projects/c++/modules/phony2/src/hello.cpp +++ b/tests/projects/c++/modules/phony2/src/hello.cpp @@ -7,11 +7,10 @@ module hello; using namespace std; namespace hello { - say::say(int data) : data_(data) { - - } +say::say(int data) : data_(data) { +} - void say::hello() { - cout << "hello, say class: " << data_ << endl; - } +void say::hello() { + cout << "hello, say class: " << data_ << endl; +} } // namespace hello diff --git a/tests/projects/c++/modules/staticlib/src/main.cpp b/tests/projects/c++/modules/staticlib/src/main.cpp index af2c328eb..ea199d05c 100644 --- a/tests/projects/c++/modules/staticlib/src/main.cpp +++ b/tests/projects/c++/modules/staticlib/src/main.cpp @@ -5,4 +5,3 @@ int main() { printf("%d\n", mod::foo()); return 0; } - diff --git a/tests/projects/c++/modules/staticlib/src/mod.cpp b/tests/projects/c++/modules/staticlib/src/mod.cpp index 9c7cf5290..34e0d0872 100644 --- a/tests/projects/c++/modules/staticlib/src/mod.cpp +++ b/tests/projects/c++/modules/staticlib/src/mod.cpp @@ -1,7 +1,7 @@ module mod; namespace mod { - int foo() { - return 2; - } +int foo() { + return 2; } +} // namespace mod diff --git a/tests/projects/c++/modules/staticlib2/src/bar.cpp b/tests/projects/c++/modules/staticlib2/src/bar.cpp index 0b5385096..4d62c82be 100644 --- a/tests/projects/c++/modules/staticlib2/src/bar.cpp +++ b/tests/projects/c++/modules/staticlib2/src/bar.cpp @@ -1,8 +1,7 @@ module bar; namespace bar { - int hello() { - return 2; - } +int hello() { + return 2; } - +} // namespace bar diff --git a/tests/projects/c++/modules/staticlib2/src/foo.cpp b/tests/projects/c++/modules/staticlib2/src/foo.cpp index 254371283..a72dfe3ca 100644 --- a/tests/projects/c++/modules/staticlib2/src/foo.cpp +++ b/tests/projects/c++/modules/staticlib2/src/foo.cpp @@ -3,8 +3,7 @@ module foo; import bar; namespace foo { - int hello() { - return bar::hello(); - } +int hello() { + return bar::hello(); } - +} // namespace foo diff --git a/tests/projects/c++/modules/staticlib2/src/main.cpp b/tests/projects/c++/modules/staticlib2/src/main.cpp index 69e91b126..0c8bebf35 100644 --- a/tests/projects/c++/modules/staticlib2/src/main.cpp +++ b/tests/projects/c++/modules/staticlib2/src/main.cpp @@ -5,4 +5,3 @@ int main() { printf("%d\n", foo::hello()); return 0; } - diff --git a/tests/projects/c++/modules/stdmodules/src/my_module.cpp b/tests/projects/c++/modules/stdmodules/src/my_module.cpp index ab3119785..786ae3a9d 100644 --- a/tests/projects/c++/modules/stdmodules/src/my_module.cpp +++ b/tests/projects/c++/modules/stdmodules/src/my_module.cpp @@ -2,4 +2,6 @@ module my_module; import std; -auto my_sum(std::size_t a, std::size_t b) -> std::size_t { return a + b; } +auto my_sum(std::size_t a, std::size_t b) -> std::size_t { + return a + b; +} diff --git a/tests/projects/c++/modules/stdmodules/test/test.cpp b/tests/projects/c++/modules/stdmodules/test/test.cpp index 7c6f7b4df..960b9c3f6 100644 --- a/tests/projects/c++/modules/stdmodules/test/test.cpp +++ b/tests/projects/c++/modules/stdmodules/test/test.cpp @@ -4,6 +4,6 @@ import my_module; using namespace std; -int main(int argc, char** argv) { +int main(int argc, char **argv) { cout << my_sum(1, 1) << endl; } diff --git a/tests/projects/c++/modules/stdmodules_cpp_only/src/main.cpp b/tests/projects/c++/modules/stdmodules_cpp_only/src/main.cpp index 477d7c742..b4a8e6c26 100644 --- a/tests/projects/c++/modules/stdmodules_cpp_only/src/main.cpp +++ b/tests/projects/c++/modules/stdmodules_cpp_only/src/main.cpp @@ -2,8 +2,7 @@ import std; using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { cout << "hello world!" << endl; return 0; } diff --git a/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp b/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp index c1e34dec6..59fd74153 100644 --- a/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp +++ b/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp @@ -1,3 +1,5 @@ module foo; -auto my_sum(std::size_t a, std::size_t b) -> std::size_t { return a + b; } +auto my_sum(std::size_t a, std::size_t b) -> std::size_t { + return a + b; +} diff --git a/tests/projects/c++/modules/stdmodules_deps/src/main.cpp b/tests/projects/c++/modules/stdmodules_deps/src/main.cpp index e40a369fa..5806de710 100644 --- a/tests/projects/c++/modules/stdmodules_deps/src/main.cpp +++ b/tests/projects/c++/modules/stdmodules_deps/src/main.cpp @@ -4,6 +4,6 @@ import bar; import std; int main() { - std::cout << my_sum(1, 2) << ":" << my_sum2(1, 2) << std::endl; - return 0; + std::cout << my_sum(1, 2) << ":" << my_sum2(1, 2) << std::endl; + return 0; } diff --git a/tests/projects/c++/modules/stdmodules_multiple_targets/src/my_module.cpp b/tests/projects/c++/modules/stdmodules_multiple_targets/src/my_module.cpp index ab3119785..786ae3a9d 100644 --- a/tests/projects/c++/modules/stdmodules_multiple_targets/src/my_module.cpp +++ b/tests/projects/c++/modules/stdmodules_multiple_targets/src/my_module.cpp @@ -2,4 +2,6 @@ module my_module; import std; -auto my_sum(std::size_t a, std::size_t b) -> std::size_t { return a + b; } +auto my_sum(std::size_t a, std::size_t b) -> std::size_t { + return a + b; +} diff --git a/tests/projects/c++/modules/submodules/src/main.cpp b/tests/projects/c++/modules/submodules/src/main.cpp index 5ff18701f..2ba0a3212 100644 --- a/tests/projects/c++/modules/submodules/src/main.cpp +++ b/tests/projects/c++/modules/submodules/src/main.cpp @@ -2,7 +2,6 @@ import math; int main() { - std::cout << std::endl; std::cout << "add(3, 4): " << add(3, 4) << std::endl; diff --git a/tests/projects/c++/modules/submodules2/src/main.cpp b/tests/projects/c++/modules/submodules2/src/main.cpp index ae58a08a3..db98c4d81 100644 --- a/tests/projects/c++/modules/submodules2/src/main.cpp +++ b/tests/projects/c++/modules/submodules2/src/main.cpp @@ -1,6 +1,6 @@ import main_module; -int main(int argc, char** argv) { +int main(int argc, char **argv) { hello(); return 0; } diff --git a/tests/projects/c++/modules/submodules2/src/module2.cpp b/tests/projects/c++/modules/submodules2/src/module2.cpp index 6ce9f9da9..09e195d39 100644 --- a/tests/projects/c++/modules/submodules2/src/module2.cpp +++ b/tests/projects/c++/modules/submodules2/src/module2.cpp @@ -6,4 +6,3 @@ module main_module.module2; void hello2(void) { printf("hello2\n"); } - diff --git a/tests/projects/c++/modules/xmake_tests1/src/main.cpp b/tests/projects/c++/modules/xmake_tests1/src/main.cpp index 7a7488a3b..a7fb45f9e 100644 --- a/tests/projects/c++/modules/xmake_tests1/src/main.cpp +++ b/tests/projects/c++/modules/xmake_tests1/src/main.cpp @@ -1,3 +1,5 @@ import Foo; -int main() { return foo(); } +int main() { + return foo(); +} diff --git a/tests/projects/c++/modules/xmake_tests2/src/main.cpp b/tests/projects/c++/modules/xmake_tests2/src/main.cpp index 7a7488a3b..a7fb45f9e 100644 --- a/tests/projects/c++/modules/xmake_tests2/src/main.cpp +++ b/tests/projects/c++/modules/xmake_tests2/src/main.cpp @@ -1,3 +1,5 @@ import Foo; -int main() { return foo(); } +int main() { + return foo(); +} diff --git a/tests/projects/c++/precompiled_header/src/header.h b/tests/projects/c++/precompiled_header/src/header.h index affda55ca..910e73544 100644 --- a/tests/projects/c++/precompiled_header/src/header.h +++ b/tests/projects/c++/precompiled_header/src/header.h @@ -1,7 +1,7 @@ // header.h #ifndef HEADER_H #define HEADER_H - + #include <algorithm> #include <deque> #include <iostream> @@ -24,4 +24,3 @@ #include <iomanip> #endif - diff --git a/tests/projects/c++/precompiled_header/src/main.cpp b/tests/projects/c++/precompiled_header/src/main.cpp index 27d41ee50..bfce631e2 100644 --- a/tests/projects/c++/precompiled_header/src/main.cpp +++ b/tests/projects/c++/precompiled_header/src/main.cpp @@ -1,7 +1,6 @@ #include "header.h" -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { std::string s("xmake"); printf("hello %s!\n", s.c_str()); return 0; diff --git a/tests/projects/c++/precompiled_header/src/test.c b/tests/projects/c++/precompiled_header/src/test.c index 7f0aa2bf4..6b15d3d8a 100644 --- a/tests/projects/c++/precompiled_header/src/test.c +++ b/tests/projects/c++/precompiled_header/src/test.c @@ -1,4 +1,3 @@ -void test_c(void) -{ +void test_c(void) { } diff --git a/tests/projects/c++/precompiled_header/src/test.cpp b/tests/projects/c++/precompiled_header/src/test.cpp index e9d6c83d9..4a526251e 100644 --- a/tests/projects/c++/precompiled_header/src/test.cpp +++ b/tests/projects/c++/precompiled_header/src/test.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test() -{ +int test() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test2.cpp b/tests/projects/c++/precompiled_header/src/test2.cpp index 596359cd2..0d9d9240f 100644 --- a/tests/projects/c++/precompiled_header/src/test2.cpp +++ b/tests/projects/c++/precompiled_header/src/test2.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test2() -{ +int test2() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test4.cpp b/tests/projects/c++/precompiled_header/src/test4.cpp index a92803eb7..ebcbe51e0 100644 --- a/tests/projects/c++/precompiled_header/src/test4.cpp +++ b/tests/projects/c++/precompiled_header/src/test4.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test4() -{ +int test4() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test5.cpp b/tests/projects/c++/precompiled_header/src/test5.cpp index 2a3e7066c..c2193ac84 100644 --- a/tests/projects/c++/precompiled_header/src/test5.cpp +++ b/tests/projects/c++/precompiled_header/src/test5.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test5() -{ +int test5() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test6.cpp b/tests/projects/c++/precompiled_header/src/test6.cpp index efbd7c6c1..03dd19a28 100644 --- a/tests/projects/c++/precompiled_header/src/test6.cpp +++ b/tests/projects/c++/precompiled_header/src/test6.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test6() -{ +int test6() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test7.cpp b/tests/projects/c++/precompiled_header/src/test7.cpp index 24aeff619..d0e0e9445 100644 --- a/tests/projects/c++/precompiled_header/src/test7.cpp +++ b/tests/projects/c++/precompiled_header/src/test7.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test7() -{ +int test7() { return 0; } diff --git a/tests/projects/c++/precompiled_header/src/test8.cpp b/tests/projects/c++/precompiled_header/src/test8.cpp index 6ad5680a6..048f2952d 100644 --- a/tests/projects/c++/precompiled_header/src/test8.cpp +++ b/tests/projects/c++/precompiled_header/src/test8.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test8() -{ +int test8() { return 0; } diff --git a/tests/projects/c++/precompiled_header/test3.cpp b/tests/projects/c++/precompiled_header/test3.cpp index 7daf91dd7..c914e1dff 100644 --- a/tests/projects/c++/precompiled_header/test3.cpp +++ b/tests/projects/c++/precompiled_header/test3.cpp @@ -2,7 +2,6 @@ #include "src/header.h" #include "src/header2.h" -int test3() -{ +int test3() { return 0; } diff --git a/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp index dc06458ae..03ede9550 100644 --- a/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp +++ b/tests/projects/c++/protobuf_grpc_cpp_plugin/src/main.cpp @@ -4,8 +4,7 @@ using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { cout << "hello world!" << endl; return 0; } diff --git a/tests/projects/c++/shared_library/src/foo.h b/tests/projects/c++/shared_library/src/foo.h index 20df0baa4..bd496c784 100644 --- a/tests/projects/c++/shared_library/src/foo.h +++ b/tests/projects/c++/shared_library/src/foo.h @@ -3,11 +3,11 @@ extern "C" { #endif #if defined(_WIN32) -# define __export __declspec(dllexport) +#define __export __declspec(dllexport) #elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -# define __export __attribute__((visibility("default"))) +#define __export __attribute__((visibility("default"))) #else -# define __export +#define __export #endif __export int add(int a, int b); diff --git a/tests/projects/c++/shared_library/src/main.cpp b/tests/projects/c++/shared_library/src/main.cpp index ed1924789..41e494481 100644 --- a/tests/projects/c++/shared_library/src/main.cpp +++ b/tests/projects/c++/shared_library/src/main.cpp @@ -3,7 +3,7 @@ using namespace std; -int main(int argc, char** argv) { +int main(int argc, char **argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; } diff --git a/tests/projects/c++/shared_library_export_all/src/bar.h b/tests/projects/c++/shared_library_export_all/src/bar.h index 687386e0a..5abca5a30 100644 --- a/tests/projects/c++/shared_library_export_all/src/bar.h +++ b/tests/projects/c++/shared_library_export_all/src/bar.h @@ -1,4 +1,4 @@ class bar { -public: + public: static int add(int a, int b); }; diff --git a/tests/projects/c++/shared_library_export_all/src/foo.h b/tests/projects/c++/shared_library_export_all/src/foo.h index e27636b94..9ec469d23 100644 --- a/tests/projects/c++/shared_library_export_all/src/foo.h +++ b/tests/projects/c++/shared_library_export_all/src/foo.h @@ -1,4 +1,4 @@ class foo { -public: + public: static int add(int a, int b); }; diff --git a/tests/projects/c++/shared_library_export_all/src/main.cpp b/tests/projects/c++/shared_library_export_all/src/main.cpp index cc95897ee..d731d7590 100644 --- a/tests/projects/c++/shared_library_export_all/src/main.cpp +++ b/tests/projects/c++/shared_library_export_all/src/main.cpp @@ -2,7 +2,7 @@ #include "bar.h" #include <iostream> -int main(int argc, char** argv) { +int main(int argc, char **argv) { std::cout << "foo::add(1, 2) = " << foo::add(1, 2) << std::endl; std::cout << "bar::add(1, 2) = " << bar::add(1, 2) << std::endl; return 0; diff --git a/tests/projects/c++/shared_library_with_soname/src/foo.h b/tests/projects/c++/shared_library_with_soname/src/foo.h index 20df0baa4..bd496c784 100644 --- a/tests/projects/c++/shared_library_with_soname/src/foo.h +++ b/tests/projects/c++/shared_library_with_soname/src/foo.h @@ -3,11 +3,11 @@ extern "C" { #endif #if defined(_WIN32) -# define __export __declspec(dllexport) +#define __export __declspec(dllexport) #elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -# define __export __attribute__((visibility("default"))) +#define __export __attribute__((visibility("default"))) #else -# define __export +#define __export #endif __export int add(int a, int b); diff --git a/tests/projects/c++/shared_library_with_soname/src/main.cpp b/tests/projects/c++/shared_library_with_soname/src/main.cpp index ed1924789..41e494481 100644 --- a/tests/projects/c++/shared_library_with_soname/src/main.cpp +++ b/tests/projects/c++/shared_library_with_soname/src/main.cpp @@ -3,7 +3,7 @@ using namespace std; -int main(int argc, char** argv) { +int main(int argc, char **argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; } diff --git a/tests/projects/c++/static_library/src/main.cpp b/tests/projects/c++/static_library/src/main.cpp index ed1924789..41e494481 100644 --- a/tests/projects/c++/static_library/src/main.cpp +++ b/tests/projects/c++/static_library/src/main.cpp @@ -3,7 +3,7 @@ using namespace std; -int main(int argc, char** argv) { +int main(int argc, char **argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; } diff --git a/tests/projects/c++/test(brackets)/src/main.cpp b/tests/projects/c++/test(brackets)/src/main.cpp index a20aef120..134c3d51a 100644 --- a/tests/projects/c++/test(brackets)/src/main.cpp +++ b/tests/projects/c++/test(brackets)/src/main.cpp @@ -3,8 +3,7 @@ using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { cout << TEST " " WORD "!" << endl; return 0; } diff --git a/tests/projects/c++/unity_build/src/bar/test4.cpp b/tests/projects/c++/unity_build/src/bar/test4.cpp index 8fe732964..5012c2235 100644 --- a/tests/projects/c++/unity_build/src/bar/test4.cpp +++ b/tests/projects/c++/unity_build/src/bar/test4.cpp @@ -3,10 +3,9 @@ #include "header.h" namespace MY_UNITY_ID { - int i = 42; +int i = 42; } -int test4() -{ +int test4() { return MY_UNITY_ID::i; } diff --git a/tests/projects/c++/unity_build/src/bar/test5.cpp b/tests/projects/c++/unity_build/src/bar/test5.cpp index afff0b46c..80beed9a4 100644 --- a/tests/projects/c++/unity_build/src/bar/test5.cpp +++ b/tests/projects/c++/unity_build/src/bar/test5.cpp @@ -3,11 +3,9 @@ #include "header.h" namespace MY_UNITY_ID { - int i = 42; +int i = 42; } -int test5() -{ +int test5() { return MY_UNITY_ID::i; } - diff --git a/tests/projects/c++/unity_build/src/bar/test6.cpp b/tests/projects/c++/unity_build/src/bar/test6.cpp index efbd7c6c1..03dd19a28 100644 --- a/tests/projects/c++/unity_build/src/bar/test6.cpp +++ b/tests/projects/c++/unity_build/src/bar/test6.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test6() -{ +int test6() { return 0; } diff --git a/tests/projects/c++/unity_build/src/foo/test.cpp b/tests/projects/c++/unity_build/src/foo/test.cpp index e9d6c83d9..4a526251e 100644 --- a/tests/projects/c++/unity_build/src/foo/test.cpp +++ b/tests/projects/c++/unity_build/src/foo/test.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test() -{ +int test() { return 0; } diff --git a/tests/projects/c++/unity_build/src/foo/test2.cpp b/tests/projects/c++/unity_build/src/foo/test2.cpp index 596359cd2..0d9d9240f 100644 --- a/tests/projects/c++/unity_build/src/foo/test2.cpp +++ b/tests/projects/c++/unity_build/src/foo/test2.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test2() -{ +int test2() { return 0; } diff --git a/tests/projects/c++/unity_build/src/header.h b/tests/projects/c++/unity_build/src/header.h index affda55ca..910e73544 100644 --- a/tests/projects/c++/unity_build/src/header.h +++ b/tests/projects/c++/unity_build/src/header.h @@ -1,7 +1,7 @@ // header.h #ifndef HEADER_H #define HEADER_H - + #include <algorithm> #include <deque> #include <iostream> @@ -24,4 +24,3 @@ #include <iomanip> #endif - diff --git a/tests/projects/c++/unity_build/src/main.cpp b/tests/projects/c++/unity_build/src/main.cpp index 27d41ee50..bfce631e2 100644 --- a/tests/projects/c++/unity_build/src/main.cpp +++ b/tests/projects/c++/unity_build/src/main.cpp @@ -1,7 +1,6 @@ #include "header.h" -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { std::string s("xmake"); printf("hello %s!\n", s.c_str()); return 0; diff --git a/tests/projects/c++/unity_build/src/test.c b/tests/projects/c++/unity_build/src/test.c index 7f0aa2bf4..6b15d3d8a 100644 --- a/tests/projects/c++/unity_build/src/test.c +++ b/tests/projects/c++/unity_build/src/test.c @@ -1,4 +1,3 @@ -void test_c(void) -{ +void test_c(void) { } diff --git a/tests/projects/c++/unity_build/src/test7.cpp b/tests/projects/c++/unity_build/src/test7.cpp index 24aeff619..d0e0e9445 100644 --- a/tests/projects/c++/unity_build/src/test7.cpp +++ b/tests/projects/c++/unity_build/src/test7.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test7() -{ +int test7() { return 0; } diff --git a/tests/projects/c++/unity_build/src/test8.cpp b/tests/projects/c++/unity_build/src/test8.cpp index 6ad5680a6..048f2952d 100644 --- a/tests/projects/c++/unity_build/src/test8.cpp +++ b/tests/projects/c++/unity_build/src/test8.cpp @@ -2,7 +2,6 @@ // main.cpp #include "header.h" -int test8() -{ +int test8() { return 0; } |
