summaryrefslogtreecommitdiff
path: root/tests/projects/c++/static_library/src
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-01 22:38:41 +0800
committerruki <[email protected]>2022-12-01 22:38:41 +0800
commit90613a344570916a4a7d197dc20d3af31a38be51 (patch)
treea2f05adfd49d82915b86749a39fcbae662b9f3d5 /tests/projects/c++/static_library/src
parent62bf14a330904ea37496d5da5bfe3a66ec3d02ec (diff)
improve tests
Diffstat (limited to 'tests/projects/c++/static_library/src')
-rw-r--r--tests/projects/c++/static_library/src/foo.cpp5
-rw-r--r--tests/projects/c++/static_library/src/foo.h9
-rw-r--r--tests/projects/c++/static_library/src/interface.cpp6
-rw-r--r--tests/projects/c++/static_library/src/interface.h16
-rw-r--r--tests/projects/c++/static_library/src/main.cpp7
5 files changed, 17 insertions, 26 deletions
diff --git a/tests/projects/c++/static_library/src/foo.cpp b/tests/projects/c++/static_library/src/foo.cpp
new file mode 100644
index 000000000..1a1fb3425
--- /dev/null
+++ b/tests/projects/c++/static_library/src/foo.cpp
@@ -0,0 +1,5 @@
+#include "foo.h"
+
+int add(int a, int b) {
+ return a + b;
+}
diff --git a/tests/projects/c++/static_library/src/foo.h b/tests/projects/c++/static_library/src/foo.h
new file mode 100644
index 000000000..d2506bca9
--- /dev/null
+++ b/tests/projects/c++/static_library/src/foo.h
@@ -0,0 +1,9 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int add(int a, int b);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/tests/projects/c++/static_library/src/interface.cpp b/tests/projects/c++/static_library/src/interface.cpp
deleted file mode 100644
index 598d07560..000000000
--- a/tests/projects/c++/static_library/src/interface.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "interface.h"
-
-int add(int a, int b)
-{
- return a + b;
-}
diff --git a/tests/projects/c++/static_library/src/interface.h b/tests/projects/c++/static_library/src/interface.h
deleted file mode 100644
index 4a41e9597..000000000
--- a/tests/projects/c++/static_library/src/interface.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*! calculate add(a, b)
- *
- * @param a the first argument
- * @param b the second argument
- *
- * @return the result
- */
-int add(int a, int b);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/tests/projects/c++/static_library/src/main.cpp b/tests/projects/c++/static_library/src/main.cpp
index 72e03272b..ed1924789 100644
--- a/tests/projects/c++/static_library/src/main.cpp
+++ b/tests/projects/c++/static_library/src/main.cpp
@@ -1,10 +1,9 @@
-#include "interface.h"
+#include "foo.h"
#include <iostream>
using namespace std;
-int main(int argc, char** argv)
-{
- cout << "add(1, 2) = " << add(1, 2) << endl;
+int main(int argc, char** argv) {
+ cout << "add(1, 2) = " << add(1, 2) << endl;
return 0;
}