aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/samplenamespace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libsample/samplenamespace.cpp')
-rw-r--r--tests/libsample/samplenamespace.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/libsample/samplenamespace.cpp b/tests/libsample/samplenamespace.cpp
new file mode 100644
index 000000000..ebf2ff74d
--- /dev/null
+++ b/tests/libsample/samplenamespace.cpp
@@ -0,0 +1,48 @@
+#include <iostream>
+#include <cstdlib>
+#include <time.h>
+#include "samplenamespace.h"
+
+using namespace std;
+
+namespace SampleNamespace
+{
+
+OutValue
+enumInEnumOut(InValue in)
+{
+ OutValue retval;
+ switch(in) {
+ case ZeroIn:
+ retval = ZeroOut;
+ break;
+ case OneIn:
+ retval = OneOut;
+ break;
+ case TwoIn:
+ retval = TwoOut;
+ break;
+ default:
+ retval = (OutValue) -1;
+ }
+ return retval;
+}
+
+int
+getNumber(Option opt)
+{
+ int retval;
+ switch(opt) {
+ case RandomNumber:
+ retval = rand() % 100;
+ break;
+ case UnixTime:
+ retval = (int) time(0);
+ break;
+ default:
+ retval = 0;
+ }
+ return retval;
+}
+
+} // namespace SampleNamespace