// File: Barath-Kannan[P]SignalsAndSlots/test/SignalTest.cpp
// Function: SignalTest_MultipleConnectionTypes_Test::TestBody()
TEST_F(SignalTest, MultipleConnectionTypes) {
    cout << "Testing multiple connection types for single signal" << endl;
    Signal<BigThing> testSignal;

    cout << "Connecting signals" << endl;
    list<int> ids;
    ids.push_back(testSignal.connectSlot(ExecutorScheme::SYNCHRONOUS, pushToQueue));
    ids.push_back(testSignal.connectSlot(ExecutorScheme::ASYNCHRONOUS, pushToQueue));
    ids.push_back(testSignal.connectSlot(ExecutorScheme::STRAND, pushToQueue));

    cout << "Emitting signal" << endl;
    BasicTimer bt;
    BasicTimer bt2;

    bt.start();
    bt2.start();
    BigThing bigthing;
    for (uint32_t i = 0; i < 10; i++) {
        testSignal.emitSignal(bigthing);
    }
    bt2.stop();

    cout << "Dequeueing" << endl;
    for (int i = 0; i < 30; i++) {
        sq.dequeue();
    }

    bt.stop();

    cout << "Signals emitted" << endl;
    cout << "Total time for emission: " << bt2.getElapsedMilliseconds() << "ms" << endl;
    cout << "Total time for emission and processing: " << bt.getElapsedMilliseconds() << "ms" << endl;
    cout << "Average emission+processing time: " << bt.getElapsedMilliseconds() / 10.0 << "ms" << endl;
    ASSERT_LT(bt2.getElapsedSeconds(), 0.1);
    ASSERT_LT(bt.getElapsedSeconds(), 0.2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x750, %rsp            # imm = 0x750
movq %rdi, -0x8(%rbp)
movq 0xe12d2(%rip), %rdi     # 0xfafb8
movq %rdi, -0x670(%rbp)
leaq 0x8bb08(%rip), %rsi     # 0xa57fc
callq 0xd640
movq %rax, %rdi
movq 0xe128d(%rip), %rsi     # 0xfaf90
callq 0xd6e0
leaq -0x120(%rbp), %rdi
callq 0x1c8e0
movq -0x670(%rbp), %rdi
leaq 0x8bb0e(%rip), %rsi     # 0xa5830
callq 0xd640
movq %rax, -0x668(%rbp)
jmp 0x19d30
movq -0x668(%rbp), %rdi
movq 0xe1252(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19d45
leaq -0x148(%rbp), %rdi
callq 0x1c900
leaq -0x2008(%rip), %rsi     # 0x17d50
leaq -0x170(%rbp), %rdi
movq %rdi, -0x680(%rbp)
callq 0x1c9e0
movq -0x680(%rbp), %rdx
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
callq 0x1c960
movl %eax, -0x674(%rbp)
jmp 0x19d88
movl -0x674(%rbp), %eax
movl %eax, -0x14c(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x14c(%rbp), %rsi
callq 0x1c920
jmp 0x19da9
leaq -0x170(%rbp), %rdi
callq 0x1ca70
leaq -0x206c(%rip), %rsi     # 0x17d50
leaq -0x198(%rbp), %rdi
movq %rdi, -0x690(%rbp)
callq 0x1c9e0
movq -0x690(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x2, %esi
callq 0x1c960
movl %eax, -0x684(%rbp)
jmp 0x19def
movl -0x684(%rbp), %eax
movl %eax, -0x174(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x174(%rbp), %rsi
callq 0x1c920
jmp 0x19e10
leaq -0x198(%rbp), %rdi
callq 0x1ca70
leaq -0x20d3(%rip), %rsi     # 0x17d50
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0x1c9e0
movq -0x6a0(%rbp), %rdx
leaq -0x120(%rbp), %rdi
movl $0x3, %esi
callq 0x1c960
movl %eax, -0x694(%rbp)
jmp 0x19e56
movl -0x694(%rbp), %eax
movl %eax, -0x19c(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x19c(%rbp), %rsi
callq 0x1c920
jmp 0x19e77
leaq -0x1c0(%rbp), %rdi
callq 0x1ca70
movq 0xe112e(%rip), %rdi     # 0xfafb8
leaq 0x8b89a(%rip), %rsi     # 0xa572b
callq 0xd640
movq %rax, -0x6a8(%rbp)
jmp 0x19e9f
movq -0x6a8(%rbp), %rdi
movq 0xe10e3(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x19eb4
leaq -0x1d8(%rbp), %rdi
callq 0xfc20
jmp 0x19ec2
leaq -0x1f0(%rbp), %rdi
callq 0xfc20
jmp 0x19ed0
leaq -0x1d8(%rbp), %rdi
callq 0xfde0
jmp 0x19ede
leaq -0x1f0(%rbp), %rdi
callq 0xfde0
jmp 0x19eec
movl $0x0, -0x3f4(%rbp)
cmpl $0xa, -0x3f4(%rbp)
jae 0x19fc2
leaq -0x120(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x1ca90
jmp 0x19f18
jmp 0x19f1a
movl -0x3f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3f4(%rbp)
jmp 0x19ef6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a564
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x1ca70
jmp 0x1a558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x1ca70
jmp 0x1a558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x1ca70
jmp 0x1a558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a558
leaq -0x1f0(%rbp), %rdi
callq 0xfe30
jmp 0x19fd0
movq 0xe0fe1(%rip), %rdi     # 0xfafb8
leaq 0x8b865(%rip), %rsi     # 0xa5843
callq 0xd640
movq %rax, -0x6b0(%rbp)
jmp 0x19fec
movq -0x6b0(%rbp), %rdi
movq 0xe0f96(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1a001
movl $0x0, -0x3f8(%rbp)
cmpl $0x1e, -0x3f8(%rbp)
jge 0x1a03c
leaq 0x13385d(%rip), %rsi    # 0x14d878
leaq -0x5f8(%rbp), %rdi
callq 0x1cac0
jmp 0x1a029
jmp 0x1a02b
movl -0x3f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3f8(%rbp)
jmp 0x1a00b
leaq -0x1d8(%rbp), %rdi
callq 0xfe30
jmp 0x1a04a
movq 0xe0f67(%rip), %rdi     # 0xfafb8
leaq 0x8b7f6(%rip), %rsi     # 0xa584e
callq 0xd640
movq %rax, -0x6b8(%rbp)
jmp 0x1a066
movq -0x6b8(%rbp), %rdi
movq 0xe0f1c(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1a07b
movq 0xe0f36(%rip), %rdi     # 0xfafb8
leaq 0x8b7d5(%rip), %rsi     # 0xa585e
callq 0xd640
movq %rax, -0x6c0(%rbp)
jmp 0x1a097
leaq -0x1f0(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x6c8(%rbp)
jmp 0x1a0ad
movsd -0x6c8(%rbp), %xmm0
movq -0x6c0(%rbp), %rdi
callq 0xddc0
movq %rax, -0x6d0(%rbp)
jmp 0x1a0ca
movq -0x6d0(%rbp), %rdi
leaq 0x8d0c3(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x6d8(%rbp)
jmp 0x1a0e6
movq -0x6d8(%rbp), %rdi
movq 0xe0e9c(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1a0fb
movq 0xe0eb6(%rip), %rdi     # 0xfafb8
leaq 0x8b76f(%rip), %rsi     # 0xa5878
callq 0xd640
movq %rax, -0x6e0(%rbp)
jmp 0x1a117
leaq -0x1d8(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x6e8(%rbp)
jmp 0x1a12d
movsd -0x6e8(%rbp), %xmm0
movq -0x6e0(%rbp), %rdi
callq 0xddc0
movq %rax, -0x6f0(%rbp)
jmp 0x1a14a
movq -0x6f0(%rbp), %rdi
leaq 0x8d043(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x6f8(%rbp)
jmp 0x1a166
movq -0x6f8(%rbp), %rdi
movq 0xe0e1c(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1a17b
movq 0xe0e36(%rip), %rdi     # 0xfafb8
leaq 0x8b718(%rip), %rsi     # 0xa58a1
callq 0xd640
movq %rax, -0x700(%rbp)
jmp 0x1a197
leaq -0x1d8(%rbp), %rdi
callq 0xfd00
movsd %xmm0, -0x708(%rbp)
jmp 0x1a1ad
movq -0x700(%rbp), %rdi
movsd -0x708(%rbp), %xmm0
movsd 0x8afcc(%rip), %xmm1    # 0xa5190
divsd %xmm1, %xmm0
callq 0xddc0
movq %rax, -0x710(%rbp)
jmp 0x1a1d6
movq -0x710(%rbp), %rdi
leaq 0x8cfb7(%rip), %rsi     # 0xa719b
callq 0xd640
movq %rax, -0x718(%rbp)
jmp 0x1a1f2
movq -0x718(%rbp), %rdi
movq 0xe0d90(%rip), %rsi     # 0xfaf90
callq 0xd6e0
jmp 0x1a207
leaq -0x1f0(%rbp), %rdi
callq 0xfc60
movsd %xmm0, -0x720(%rbp)
jmp 0x1a21d
movsd -0x720(%rbp), %xmm0
movsd %xmm0, -0x610(%rbp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, -0x618(%rbp)
leaq 0x8b545(%rip), %rsi     # 0xa578a
leaq 0x8b556(%rip), %rdx     # 0xa57a2
leaq -0x608(%rbp), %rdi
leaq -0x610(%rbp), %rcx
leaq -0x618(%rbp), %r8
callq 0x1c7c0
jmp 0x1a268
leaq -0x608(%rbp), %rdi
callq 0x1c500
movb %al, -0x721(%rbp)
jmp 0x1a27c
movb -0x721(%rbp), %al
testb $0x1, %al
jne 0x1a288
jmp 0x1a2a4
jmp 0x1a369
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a415
leaq -0x620(%rbp), %rdi
callq 0x6f130
jmp 0x1a2b2
leaq -0x608(%rbp), %rdi
callq 0x1c520
movq %rax, -0x730(%rbp)
jmp 0x1a2c7
movq -0x730(%rbp), %r8
leaq 0x8b3d6(%rip), %rdx     # 0xa56ab
leaq -0x628(%rbp), %rdi
movl $0x2, %esi
movl $0xde, %ecx
callq 0x6c7e0
jmp 0x1a2ed
leaq -0x628(%rbp), %rdi
leaq -0x620(%rbp), %rsi
callq 0x6c8a0
jmp 0x1a302
leaq -0x628(%rbp), %rdi
callq 0x6c860
leaq -0x620(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x62c(%rbp)
jmp 0x1a373
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a358
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x628(%rbp), %rdi
callq 0x6c860
leaq -0x620(%rbp), %rdi
callq 0x1c540
jmp 0x1a415
movl $0x0, -0x62c(%rbp)
leaq -0x608(%rbp), %rdi
callq 0x1c560
movl -0x62c(%rbp), %eax
testl %eax, %eax
jne 0x1a52b
jmp 0x1a38f
leaq -0x1d8(%rbp), %rdi
callq 0xfc60
movsd %xmm0, -0x738(%rbp)
jmp 0x1a3a5
movsd -0x738(%rbp), %xmm0
movsd %xmm0, -0x648(%rbp)
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
movq %rax, -0x650(%rbp)
leaq 0x8b4f7(%rip), %rsi     # 0xa58c4
leaq 0x8b507(%rip), %rdx     # 0xa58db
leaq -0x640(%rbp), %rdi
leaq -0x648(%rbp), %rcx
leaq -0x650(%rbp), %r8
callq 0x1c7c0
jmp 0x1a3f0
leaq -0x640(%rbp), %rdi
callq 0x1c500
movb %al, -0x739(%rbp)
jmp 0x1a404
movb -0x739(%rbp), %al
testb $0x1, %al
jne 0x1a410
jmp 0x1a43d
jmp 0x1a4ff
leaq -0x608(%rbp), %rdi
callq 0x1c560
jmp 0x1a558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a54c
leaq -0x658(%rbp), %rdi
callq 0x6f130
jmp 0x1a44b
leaq -0x640(%rbp), %rdi
callq 0x1c520
movq %rax, -0x748(%rbp)
jmp 0x1a460
movq -0x748(%rbp), %r8
leaq 0x8b23d(%rip), %rdx     # 0xa56ab
leaq -0x660(%rbp), %rdi
movl $0x2, %esi
movl $0xdf, %ecx
callq 0x6c7e0
jmp 0x1a486
leaq -0x660(%rbp), %rdi
leaq -0x658(%rbp), %rsi
callq 0x6c8a0
jmp 0x1a49b
leaq -0x660(%rbp), %rdi
callq 0x6c860
leaq -0x658(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x62c(%rbp)
jmp 0x1a509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x1a4f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x660(%rbp), %rdi
callq 0x6c860
leaq -0x658(%rbp), %rdi
callq 0x1c540
jmp 0x1a54c
movl $0x0, -0x62c(%rbp)
leaq -0x640(%rbp), %rdi
callq 0x1c560
movl -0x62c(%rbp), %eax
testl %eax, %eax
jne 0x1a52b
jmp 0x1a521
movl $0x0, -0x62c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x1cbf0
leaq -0x120(%rbp), %rdi
callq 0x1cc10
addq $0x750, %rsp            # imm = 0x750
popq %rbp
retq
leaq -0x640(%rbp), %rdi
callq 0x1c560
leaq -0x148(%rbp), %rdi
callq 0x1cbf0
leaq -0x120(%rbp), %rdi
callq 0x1cc10
movq -0x128(%rbp), %rdi
callq 0xdcb0
nopl (%rax)