aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/activetest.cpp38
-rw-r--r--tests/logtest.cpp6
-rw-r--r--tests/syncqueuetest.cpp3
3 files changed, 42 insertions, 5 deletions
diff --git a/tests/activetest.cpp b/tests/activetest.cpp
new file mode 100644
index 00000000..74e72f54
--- /dev/null
+++ b/tests/activetest.cpp
@@ -0,0 +1,38 @@
+#include <yage.h>
+
+#include <iostream>
+
+using namespace yage;
+
+void print_random()
+{
+ std::cout << "hello world"
+ << "\n";
+}
+
+void print_h()
+{
+ std::cout << "Helllllllo"
+ << "\n";
+}
+
+void flush()
+{
+ std::cout << "flush" << std::endl;
+}
+
+int main()
+{
+ auto a = Active::create();
+
+ a->send(print_random);
+ a->send(print_h);
+ a->send(flush);
+
+ std::cout << std::endl;
+
+ for (int i = 0; i < 1000000; i++) {
+ }
+
+ std::cout << std::endl;
+}
diff --git a/tests/logtest.cpp b/tests/logtest.cpp
index 359311ec..9536f00a 100644
--- a/tests/logtest.cpp
+++ b/tests/logtest.cpp
@@ -12,8 +12,8 @@
int main()
{
- gLog << "Hello World";
+ gLog << "First message";
- gLog << "This is Yann";
- std::cout << "Hello\n";
+ gLog << "Second Message";
+ std::cout << "COUT\n";
}
diff --git a/tests/syncqueuetest.cpp b/tests/syncqueuetest.cpp
index cb9a920e..07167dc6 100644
--- a/tests/syncqueuetest.cpp
+++ b/tests/syncqueuetest.cpp
@@ -6,7 +6,7 @@
using namespace yage;
SyncQueue<int> queue;
-std::atomic_int j;
+std::atomic_int j(0);
void push_to_queue1(int elements)
{
@@ -28,7 +28,6 @@ void push_to_queue2(int elements)
int main()
{
- j.store(0);
std::thread first(push_to_queue1, 100000);
std::thread second(push_to_queue2, 100000);