aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_statics.in
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-14 16:04:52 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-15 20:51:29 +0200
commitc05cdf26c872f76dad82194305c28a53e9123677 (patch)
treeb9c48a759b8b2e58c4714e11aa8cd992de8bd0a4 /tests/core/test_statics.in
parent94e1d887ffebcbf640fbca19c76331f6dffbff23 (diff)
Fix the indentation of core test input files with clang-format.
Diffstat (limited to 'tests/core/test_statics.in')
-rw-r--r--tests/core/test_statics.in64
1 files changed, 30 insertions, 34 deletions
diff --git a/tests/core/test_statics.in b/tests/core/test_statics.in
index 0935aade..d3302db5 100644
--- a/tests/core/test_statics.in
+++ b/tests/core/test_statics.in
@@ -1,39 +1,35 @@
+#include <stdio.h>
+#include <string.h>
- #include <stdio.h>
- #include <string.h>
+#define CONSTRLEN 32
- #define CONSTRLEN 32
+char *(*func)(char *, const char *) = NULL;
- char * (*func)(char *, const char *) = NULL;
+void conoutfv(const char *fmt) {
+ static char buf[CONSTRLEN];
+ func(buf, fmt); // call by function pointer to make sure we test strcpy here
+ puts(buf);
+}
- void conoutfv(const char *fmt)
- {
- static char buf[CONSTRLEN];
- func(buf, fmt); // call by function pointer to make sure we test strcpy here
- puts(buf);
- }
+struct XYZ {
+ float x, y, z;
+ XYZ(float a, float b, float c) : x(a), y(b), z(c) {}
+ static const XYZ &getIdentity() {
+ static XYZ iT(1, 2, 3);
+ return iT;
+ }
+};
+struct S {
+ static const XYZ &getIdentity() {
+ static const XYZ iT(XYZ::getIdentity());
+ return iT;
+ }
+};
- struct XYZ {
- float x, y, z;
- XYZ(float a, float b, float c) : x(a), y(b), z(c) { }
- static const XYZ& getIdentity()
- {
- static XYZ iT(1,2,3);
- return iT;
- }
- };
- struct S {
- static const XYZ& getIdentity()
- {
- static const XYZ iT(XYZ::getIdentity());
- return iT;
- }
- };
-
- int main() {
- func = &strcpy;
- conoutfv("*staticccz*");
- printf("*%.2f,%.2f,%.2f*\n", S::getIdentity().x, S::getIdentity().y, S::getIdentity().z);
- return 0;
- }
- \ No newline at end of file
+int main() {
+ func = &strcpy;
+ conoutfv("*staticccz*");
+ printf("*%.2f,%.2f,%.2f*\n", S::getIdentity().x, S::getIdentity().y,
+ S::getIdentity().z);
+ return 0;
+}