// File: Barath-Kannan[P]SignalsAndSlots/test/SignalTest.cpp
// Function: SignalTest_StrandSignal_Test::TestBody()
TEST_F(SignalTest, StrandSignal) {
    cout << "Instantiating signal object" << endl;

    Signal<int, int> testSignal;

    BasicTimer bt;
    BasicTimer bt2;
    cout << "Connecting signal" << endl;
    bt.start();
    int id = testSignal.connectSlot(ExecutorScheme::STRAND, staticSumFunction);
    bt.stop();
    cout << "Time to connect: " << bt.getElapsedMilliseconds() << "ms" << endl;

    cout << "Emitting signal" << endl;

    bt.start();
    bt2.start();
    testSignal.emitSignal(1, 2);
    bt.stop();

    while (bt2.getElapsedSeconds() < 0.1) {
        if (globalStaticIntX == 3) {
            bt2.stop();
            break;
        }
    }
    ASSERT_LT(bt2.getElapsedSeconds(), 0.1);
    ASSERT_EQ(globalStaticIntX, 3);

    cout << "Time to emit: " << bt.getElapsedMilliseconds() << "ms" << endl;
    cout << "Time to emit and process: " << bt2.getElapsedMilliseconds() << "ms" << endl;
    cout << "Net time to process: " << bt2.getElapsedMilliseconds() - bt.getElapsedMilliseconds() << "ms" << endl;

    ASSERT_EQ(0, id);

    testSignal.disconnectAllSlots();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq 0xe1bb2(%rip), %rdi     # 0xfafb8
leaq 0x8c2b2(%rip), %rsi     # 0xa56bf
callq 0xd640
movq %rax, %rdi
movq 0xe1b74(%rip), %rsi     # 0xfaf90
callq 0xd6e0
leaq -0x120(%rbp), %rdi
callq 0x1c140
leaq -0x138(%rbp), %rdi
callq 0xfc20
jmp 0x1943b
leaq -0x160(%rbp), %rdi
callq 0xfc20
jmp 0x19449
movq 0xe1b68(%rip), %rdi     # 0xfafb8
leaq 0x8c2b0(%rip), %rsi     # 0xa5707
callq 0xd640
movq %rax, -0x220(%rbp)
jmp 0x19465
movq -0x220(%rbp), %rdi
movq 0xe1b1d(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1947a
leaq -0x138(%rbp), %rdi
callq 0xfde0
jmp 0x19488
leaq -0x171f(%rip), %rsi     # 0x17d70
leaq -0x188(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x1c3d0
movq -0x230(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x3, %esi
callq 0x1c350
movl %eax, -0x224(%rbp)
jmp 0x194c2
leaq -0x188(%rbp), %rdi
callq 0x1c460
movl -0x224(%rbp), %eax
movl %eax, -0x164(%rbp)
leaq -0x138(%rbp), %rdi
callq 0xfe30
jmp 0x194e8
movq 0xe1ac9(%rip), %rdi     # 0xfafb8
leaq 0x8c223(%rip), %rsi     # 0xa5719
callq 0xd640
movq %rax, -0x238(%rbp)
jmp 0x19504
leaq -0x138(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x240(%rbp)
jmp 0x1951a
movsd -0x240(%rbp), %xmm0
movq -0x238(%rbp), %rdi
callq 0xddc0
movq %rax, -0x248(%rbp)
jmp 0x19537
movq -0x248(%rbp), %rdi
leaq 0x8dc56(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x250(%rbp)
jmp 0x19553
movq -0x250(%rbp), %rdi
movq 0xe1a2f(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19568
movq 0xe1a49(%rip), %rdi     # 0xfafb8
leaq 0x8c1b5(%rip), %rsi     # 0xa572b
callq 0xd640
movq %rax, -0x258(%rbp)
jmp 0x19584
movq -0x258(%rbp), %rdi
movq 0xe19fe(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19599
leaq -0x138(%rbp), %rdi
callq 0xfde0
jmp 0x195a7
leaq -0x160(%rbp), %rdi
callq 0xfde0
jmp 0x195b5
movl $0x1, -0x18c(%rbp)
movl $0x2, -0x190(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x18c(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x1c710
jmp 0x195e5
leaq -0x138(%rbp), %rdi
callq 0xfe30
jmp 0x195f3
jmp 0x195f5
leaq -0x160(%rbp), %rdi
callq 0xfc60
movsd %xmm0, -0x260(%rbp)
jmp 0x1960b
movsd -0x260(%rbp), %xmm1
movsd 0x8bb6d(%rip), %xmm0    # 0xa5188
ucomisd %xmm1, %xmm0
jbe 0x19681
leaq 0x13424c(%rip), %rdi    # 0x14d874
callq 0x1c740
cmpl $0x3, %eax
jne 0x1967c
leaq -0x160(%rbp), %rdi
callq 0xfe30
jmp 0x19640
jmp 0x19681
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x19cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x1c460
jmp 0x19cb7
jmp 0x195f5
leaq -0x160(%rbp), %rdi
callq 0xfc60
movsd %xmm0, -0x268(%rbp)
jmp 0x19697
movsd -0x268(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, -0x1b0(%rbp)
leaq 0x8c0cb(%rip), %rsi     # 0xa578a
leaq 0x8c0dc(%rip), %rdx     # 0xa57a2
leaq -0x1a0(%rbp), %rdi
leaq -0x1a8(%rbp), %rcx
leaq -0x1b0(%rbp), %r8
callq 0x1c7c0
jmp 0x196e2
leaq -0x1a0(%rbp), %rdi
callq 0x1c500
movb %al, -0x269(%rbp)
jmp 0x196f6
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0x19702
jmp 0x1971e
jmp 0x197e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x1985f
leaq -0x1b8(%rbp), %rdi
callq 0x6f130
jmp 0x1972c
leaq -0x1a0(%rbp), %rdi
callq 0x1c520
movq %rax, -0x278(%rbp)
jmp 0x19741
movq -0x278(%rbp), %r8
leaq 0x8bf5c(%rip), %rdx     # 0xa56ab
leaq -0x1c0(%rbp), %rdi
movl $0x2, %esi
movl $0xb0, %ecx
callq 0x6c7e0
jmp 0x19767
leaq -0x1c0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x6c8a0
jmp 0x1977c
leaq -0x1c0(%rbp), %rdi
callq 0x6c860
leaq -0x1b8(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x1c4(%rbp)
jmp 0x197ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x197d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x6c860
leaq -0x1b8(%rbp), %rdi
callq 0x1c540
jmp 0x1985f
movl $0x0, -0x1c4(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x1c560
movl -0x1c4(%rbp), %eax
testl %eax, %eax
jne 0x19c96
jmp 0x19806
movl $0x3, -0x1dc(%rbp)
leaq 0x8bf33(%rip), %rsi     # 0xa574a
leaq 0x8bf3d(%rip), %rdx     # 0xa575b
leaq 0x13404f(%rip), %rcx    # 0x14d874
leaq -0x1d8(%rbp), %rdi
leaq -0x1dc(%rbp), %r8
callq 0x1c4b0
jmp 0x1983a
leaq -0x1d8(%rbp), %rdi
callq 0x1c500
movb %al, -0x279(%rbp)
jmp 0x1984e
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x1985a
jmp 0x19887
jmp 0x1994c
leaq -0x1a0(%rbp), %rdi
callq 0x1c560
jmp 0x19cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x19b72
leaq -0x1e8(%rbp), %rdi
callq 0x6f130
jmp 0x19895
leaq -0x1d8(%rbp), %rdi
callq 0x1c520
movq %rax, -0x288(%rbp)
jmp 0x198aa
movq -0x288(%rbp), %r8
leaq 0x8bdf3(%rip), %rdx     # 0xa56ab
leaq -0x1f0(%rbp), %rdi
movl $0x2, %esi
movl $0xb1, %ecx
callq 0x6c7e0
jmp 0x198d0
leaq -0x1f0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x6c8a0
jmp 0x198e5
leaq -0x1f0(%rbp), %rdi
callq 0x6c860
leaq -0x1e8(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x1c4(%rbp)
jmp 0x19956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x1993b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x6c860
leaq -0x1e8(%rbp), %rdi
callq 0x1c540
jmp 0x19b72
movl $0x0, -0x1c4(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x1c560
movl -0x1c4(%rbp), %eax
testl %eax, %eax
jne 0x19c96
jmp 0x19972
movq 0xe163f(%rip), %rdi     # 0xfafb8
leaq 0x8bdbb(%rip), %rsi     # 0xa573b
callq 0xd640
movq %rax, -0x290(%rbp)
jmp 0x1998e
leaq -0x138(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x298(%rbp)
jmp 0x199a4
movsd -0x298(%rbp), %xmm0
movq -0x290(%rbp), %rdi
callq 0xddc0
movq %rax, -0x2a0(%rbp)
jmp 0x199c1
movq -0x2a0(%rbp), %rdi
leaq 0x8d7cc(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x2a8(%rbp)
jmp 0x199dd
movq -0x2a8(%rbp), %rdi
movq 0xe15a5(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x199f2
movq 0xe15bf(%rip), %rdi     # 0xfafb8
leaq 0x8bda6(%rip), %rsi     # 0xa57a6
callq 0xd640
movq %rax, -0x2b0(%rbp)
jmp 0x19a0e
leaq -0x160(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x2b8(%rbp)
jmp 0x19a24
movsd -0x2b8(%rbp), %xmm0
movq -0x2b0(%rbp), %rdi
callq 0xddc0
movq %rax, -0x2c0(%rbp)
jmp 0x19a41
movq -0x2c0(%rbp), %rdi
leaq 0x8d74c(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x2c8(%rbp)
jmp 0x19a5d
movq -0x2c8(%rbp), %rdi
movq 0xe1525(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19a72
movq 0xe153f(%rip), %rdi     # 0xfafb8
leaq 0x8bd41(%rip), %rsi     # 0xa57c1
callq 0xd640
movq %rax, -0x2d0(%rbp)
jmp 0x19a8e
leaq -0x160(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x2d8(%rbp)
jmp 0x19aa4
leaq -0x138(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x2e0(%rbp)
jmp 0x19aba
movq -0x2d0(%rbp), %rdi
movsd -0x2e0(%rbp), %xmm1
movsd -0x2d8(%rbp), %xmm0
subsd %xmm1, %xmm0
callq 0xddc0
movq %rax, -0x2e8(%rbp)
jmp 0x19ae3
movq -0x2e8(%rbp), %rdi
leaq 0x8d6aa(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x2f0(%rbp)
jmp 0x19aff
movq -0x2f0(%rbp), %rdi
movq 0xe1483(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19b14
movl $0x0, -0x204(%rbp)
leaq 0x91c2a(%rip), %rsi     # 0xab74f
leaq 0x90fcd(%rip), %rdx     # 0xaaaf9
xorl %eax, %eax
movl %eax, %r9d
leaq -0x200(%rbp), %rdi
leaq -0x204(%rbp), %rcx
leaq -0x164(%rbp), %r8
callq 0x1c580
jmp 0x19b4d
leaq -0x200(%rbp), %rdi
callq 0x1c500
movb %al, -0x2f1(%rbp)
jmp 0x19b61
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x19b6d
jmp 0x19b9a
jmp 0x19c5c
leaq -0x1d8(%rbp), %rdi
callq 0x1c560
jmp 0x19cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x19cab
leaq -0x210(%rbp), %rdi
callq 0x6f130
jmp 0x19ba8
leaq -0x200(%rbp), %rdi
callq 0x1c520
movq %rax, -0x300(%rbp)
jmp 0x19bbd
movq -0x300(%rbp), %r8
leaq 0x8bae0(%rip), %rdx     # 0xa56ab
leaq -0x218(%rbp), %rdi
movl $0x2, %esi
movl $0xb7, %ecx
callq 0x6c7e0
jmp 0x19be3
leaq -0x218(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x6c8a0
jmp 0x19bf8
leaq -0x218(%rbp), %rdi
callq 0x6c860
leaq -0x210(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x1c4(%rbp)
jmp 0x19c66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x19c4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x6c860
leaq -0x210(%rbp), %rdi
callq 0x1c540
jmp 0x19cab
movl $0x0, -0x1c4(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x1c560
movl -0x1c4(%rbp), %eax
testl %eax, %eax
jne 0x19c96
jmp 0x19c7e
leaq -0x120(%rbp), %rdi
callq 0x1c880
jmp 0x19c8c
movl $0x0, -0x1c4(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x1c2f0
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x200(%rbp), %rdi
callq 0x1c560
leaq -0x120(%rbp), %rdi
callq 0x1c2f0
movq -0x140(%rbp), %rdi
callq 0xdcb0
nop