summaryrefslogtreecommitdiff
path: root/test/test07.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test07.cpp')
-rw-r--r--test/test07.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/test07.cpp b/test/test07.cpp
new file mode 100644
index 0000000..dad8a18
--- /dev/null
+++ b/test/test07.cpp
@@ -0,0 +1,65 @@
+#include <string>
+#include <vector>
+
+struct Struct1
+{
+ Struct1() :
+ str(),
+ num(0)
+ {
+ }
+
+ std::string str;
+ int num;
+};
+
+class Object1
+{
+ int k;
+ std::vector<Struct1*> vec1;
+
+ void func1()
+ {
+ }
+
+ void func2(int *aptr)
+ {
+ *aptr = 0;
+ }
+
+ void func3(int *aptr)
+ {
+ if (aptr)
+ *aptr = 0;
+ }
+
+ void func4(int *aptr)
+ {
+ k = 3;
+ }
+
+ void func5(Struct1 *sptr)
+ {
+ sptr->num = 0;
+ }
+
+ void func6(Struct1 *sptr)
+ {
+ if (!sptr)
+ return;
+ sptr->num = 0;
+ }
+
+ void func7(Struct1 *const sptr)
+ {
+ if (!sptr)
+ return;
+ vec1.push_back(sptr);
+ }
+
+ void func8(Struct1 *sptr)
+ {
+ k = 10;
+ this->k = 20;
+ }
+};