17 #include "my_config.h"
18 #include <gtest/gtest.h>
26 #include "runtime.hpp"
27 #include "yassl_int.hpp"
29 #include "thread_utils.h"
36 class Yassl_thread :
public Thread
39 Yassl_thread(Notification *go, Notification *done)
40 : m_sessions_instance(NULL), m_go(go), m_done(done)
45 m_go->wait_for_notification();
47 m_sessions_instance= &sessions;
66 TEST(YasslTest, ManySessions)
70 Yassl_thread t0(&go[0], &done[0]);
71 Yassl_thread t1(&go[1], &done[1]);
72 Yassl_thread t2(&go[2], &done[2]);
73 Yassl_thread t3(&go[3], &done[3]);
74 Yassl_thread t4(&go[4], &done[4]);
82 for (
int ix= 0; ix < 5; ++ix)
85 for (
int ix= 0; ix < 5; ++ix)
86 done[ix].wait_for_notification();
89 EXPECT_EQ(t0.m_sessions_instance, t1.m_sessions_instance);
90 EXPECT_EQ(t0.m_sessions_instance, t2.m_sessions_instance);
91 EXPECT_EQ(t0.m_sessions_instance, t3.m_sessions_instance);
92 EXPECT_EQ(t0.m_sessions_instance, t4.m_sessions_instance);
95 EXPECT_EQ(t1.m_sessions_instance, t2.m_sessions_instance);
96 EXPECT_EQ(t1.m_sessions_instance, t3.m_sessions_instance);
97 EXPECT_EQ(t1.m_sessions_instance, t4.m_sessions_instance);
99 EXPECT_EQ(t2.m_sessions_instance, t3.m_sessions_instance);
100 EXPECT_EQ(t2.m_sessions_instance, t4.m_sessions_instance);
102 EXPECT_EQ(t3.m_sessions_instance, t4.m_sessions_instance);