// File: Barath-Kannan[P]SignalsAndSlots/test/SignalTest.cpp
// Function: SignalTest_MemberFunction_Test::TestBody()
TEST_F(SignalTest, MemberFunction) {
    TestClass tc;
    Signal<int> testSignal;

    testSignal.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuff, tc);
    testSignal.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuffconst, tc);

    testSignal.emitSignal(1);

    ASSERT_EQ(tc.getCounter(), 2u);

    tc.emitIncrement();

    ASSERT_EQ(tc.getCounter(), 3u);

    testSignal.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuff, &tc);

    testSignal.emitSignal(1);
    ASSERT_EQ(tc.getCounter(), 6u);

    Signal<int> testSignal2;
    testSignal2.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuffconst, tc);

    testSignal2.emitSignal(1);

    ASSERT_EQ(tc.getCounter(), 7u);

    const TestClass tc2;

    testSignal2.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuffconst, tc2);
    testSignal2.connectMemberSlot(ExecutorScheme::SYNCHRONOUS, &TestClass::dostuffconst, &tc2);
    testSignal2.emitSignal(1);
    ASSERT_EQ(tc2.getCounter(), 2u);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movq %rdi, -0x8(%rbp)
leaq -0x128(%rbp), %rdi
movq %rdi, -0x5f0(%rbp)
callq 0x1cc70
leaq -0x240(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x1cd00
movq -0x5f8(%rbp), %rdi
movq -0x5f0(%rbp), %rcx
leaq 0x2796(%rip), %rax      # 0x1cd60
movq %rax, -0x250(%rbp)
movq $0x0, -0x248(%rbp)
xorl %esi, %esi
leaq -0x250(%rbp), %rdx
callq 0x1cd20
jmp 0x1a5ec
leaq 0x283d(%rip), %rax      # 0x1ce30
movq %rax, -0x270(%rbp)
movq $0x0, -0x268(%rbp)
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
leaq -0x270(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0x1cdf0
jmp 0x1a623
movl $0x1, -0x274(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x274(%rbp), %rsi
callq 0x1cec0
jmp 0x1a642
leaq -0x128(%rbp), %rdi
callq 0x1cf40
movl %eax, -0x5fc(%rbp)
jmp 0x1a656
movl -0x5fc(%rbp), %eax
movl %eax, -0x28c(%rbp)
movl $0x2, -0x290(%rbp)
leaq 0x8b27b(%rip), %rsi     # 0xa58ee
leaq 0x8b284(%rip), %rdx     # 0xa58fe
leaq -0x288(%rbp), %rdi
leaq -0x28c(%rbp), %rcx
leaq -0x290(%rbp), %r8
callq 0x1cef0
jmp 0x1a696
leaq -0x288(%rbp), %rdi
callq 0x1c500
movb %al, -0x5fd(%rbp)
jmp 0x1a6aa
movb -0x5fd(%rbp), %al
testb $0x1, %al
jne 0x1a6b6
jmp 0x1a6e9
jmp 0x1a7ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1b016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1a85b
leaq -0x298(%rbp), %rdi
callq 0x6f130
jmp 0x1a6f7
leaq -0x288(%rbp), %rdi
callq 0x1c520
movq %rax, -0x608(%rbp)
jmp 0x1a70c
movq -0x608(%rbp), %r8
leaq 0x8af91(%rip), %rdx     # 0xa56ab
leaq -0x2a0(%rbp), %rdi
movl $0x2, %esi
movl $0x118, %ecx            # imm = 0x118
callq 0x6c7e0
jmp 0x1a732
leaq -0x2a0(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x6c8a0
jmp 0x1a747
leaq -0x2a0(%rbp), %rdi
callq 0x6c860
leaq -0x298(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x2a4(%rbp)
jmp 0x1a7b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1a79d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x6c860
leaq -0x298(%rbp), %rdi
callq 0x1c540
jmp 0x1a85b
movl $0x0, -0x2a4(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x1c560
movl -0x2a4(%rbp), %eax
testl %eax, %eax
jne 0x1afd1
jmp 0x1a7d4
leaq -0x128(%rbp), %rdi
callq 0x1cf60
jmp 0x1a7e2
leaq -0x128(%rbp), %rdi
callq 0x1cf40
movl %eax, -0x60c(%rbp)
jmp 0x1a7f6
movl -0x60c(%rbp), %eax
movl %eax, -0x2bc(%rbp)
movl $0x3, -0x2c0(%rbp)
leaq 0x8b0db(%rip), %rsi     # 0xa58ee
leaq 0x8b0e7(%rip), %rdx     # 0xa5901
leaq -0x2b8(%rbp), %rdi
leaq -0x2bc(%rbp), %rcx
leaq -0x2c0(%rbp), %r8
callq 0x1cef0
jmp 0x1a836
leaq -0x2b8(%rbp), %rdi
callq 0x1c500
movb %al, -0x60d(%rbp)
jmp 0x1a84a
movb -0x60d(%rbp), %al
testb $0x1, %al
jne 0x1a856
jmp 0x1a883
jmp 0x1a948
leaq -0x288(%rbp), %rdi
callq 0x1c560
jmp 0x1b016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1aa4b
leaq -0x2c8(%rbp), %rdi
callq 0x6f130
jmp 0x1a891
leaq -0x2b8(%rbp), %rdi
callq 0x1c520
movq %rax, -0x618(%rbp)
jmp 0x1a8a6
movq -0x618(%rbp), %r8
leaq 0x8adf7(%rip), %rdx     # 0xa56ab
leaq -0x2d0(%rbp), %rdi
movl $0x2, %esi
movl $0x11c, %ecx            # imm = 0x11C
callq 0x6c7e0
jmp 0x1a8cc
leaq -0x2d0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x6c8a0
jmp 0x1a8e1
leaq -0x2d0(%rbp), %rdi
callq 0x6c860
leaq -0x2c8(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x2a4(%rbp)
jmp 0x1a952
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1a937
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x6c860
leaq -0x2c8(%rbp), %rdi
callq 0x1c540
jmp 0x1aa4b
movl $0x0, -0x2a4(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x1c560
movl -0x2a4(%rbp), %eax
testl %eax, %eax
jne 0x1afd1
jmp 0x1a96e
leaq 0x23eb(%rip), %rax      # 0x1cd60
movq %rax, -0x2e0(%rbp)
movq $0x0, -0x2d8(%rbp)
leaq -0x128(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
leaq -0x2e0(%rbp), %rdx
leaq -0x2e8(%rbp), %rcx
callq 0x1cff0
jmp 0x1a9b3
movl $0x1, -0x2ec(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x2ec(%rbp), %rsi
callq 0x1cec0
jmp 0x1a9d2
leaq -0x128(%rbp), %rdi
callq 0x1cf40
movl %eax, -0x61c(%rbp)
jmp 0x1a9e6
movl -0x61c(%rbp), %eax
movl %eax, -0x304(%rbp)
movl $0x6, -0x308(%rbp)
leaq 0x8aeeb(%rip), %rsi     # 0xa58ee
leaq 0x8aefa(%rip), %rdx     # 0xa5904
leaq -0x300(%rbp), %rdi
leaq -0x304(%rbp), %rcx
leaq -0x308(%rbp), %r8
callq 0x1cef0
jmp 0x1aa26
leaq -0x300(%rbp), %rdi
callq 0x1c500
movb %al, -0x61d(%rbp)
jmp 0x1aa3a
movb -0x61d(%rbp), %al
testb $0x1, %al
jne 0x1aa46
jmp 0x1aa73
jmp 0x1ab38
leaq -0x2b8(%rbp), %rdi
callq 0x1c560
jmp 0x1b016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1ac40
leaq -0x310(%rbp), %rdi
callq 0x6f130
jmp 0x1aa81
leaq -0x300(%rbp), %rdi
callq 0x1c520
movq %rax, -0x628(%rbp)
jmp 0x1aa96
movq -0x628(%rbp), %r8
leaq 0x8ac07(%rip), %rdx     # 0xa56ab
leaq -0x318(%rbp), %rdi
movl $0x2, %esi
movl $0x121, %ecx            # imm = 0x121
callq 0x6c7e0
jmp 0x1aabc
leaq -0x318(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x6c8a0
jmp 0x1aad1
leaq -0x318(%rbp), %rdi
callq 0x6c860
leaq -0x310(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x2a4(%rbp)
jmp 0x1ab42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1ab27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x6c860
leaq -0x310(%rbp), %rdi
callq 0x1c540
jmp 0x1ac40
movl $0x0, -0x2a4(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x1c560
movl -0x2a4(%rbp), %eax
testl %eax, %eax
jne 0x1afd1
jmp 0x1ab5e
leaq -0x430(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x1cd00
movq -0x630(%rbp), %rdi
leaq 0x22b1(%rip), %rax      # 0x1ce30
movq %rax, -0x440(%rbp)
movq $0x0, -0x438(%rbp)
xorl %esi, %esi
leaq -0x440(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0x1cdf0
jmp 0x1aba8
movl $0x1, -0x444(%rbp)
leaq -0x430(%rbp), %rdi
leaq -0x444(%rbp), %rsi
callq 0x1cec0
jmp 0x1abc7
leaq -0x128(%rbp), %rdi
callq 0x1cf40
movl %eax, -0x634(%rbp)
jmp 0x1abdb
movl -0x634(%rbp), %eax
movl %eax, -0x45c(%rbp)
movl $0x7, -0x460(%rbp)
leaq 0x8acf6(%rip), %rsi     # 0xa58ee
leaq 0x8ad08(%rip), %rdx     # 0xa5907
leaq -0x458(%rbp), %rdi
leaq -0x45c(%rbp), %rcx
leaq -0x460(%rbp), %r8
callq 0x1cef0
jmp 0x1ac1b
leaq -0x458(%rbp), %rdi
callq 0x1c500
movb %al, -0x635(%rbp)
jmp 0x1ac2f
movb -0x635(%rbp), %al
testb $0x1, %al
jne 0x1ac3b
jmp 0x1ac7f
jmp 0x1ad44
leaq -0x300(%rbp), %rdi
callq 0x1c560
jmp 0x1b016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1b00a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1ae8c
leaq -0x468(%rbp), %rdi
callq 0x6f130
jmp 0x1ac8d
leaq -0x458(%rbp), %rdi
callq 0x1c520
movq %rax, -0x640(%rbp)
jmp 0x1aca2
movq -0x640(%rbp), %r8
leaq 0x8a9fb(%rip), %rdx     # 0xa56ab
leaq -0x470(%rbp), %rdi
movl $0x2, %esi
movl $0x128, %ecx            # imm = 0x128
callq 0x6c7e0
jmp 0x1acc8
leaq -0x470(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0x6c8a0
jmp 0x1acdd
leaq -0x470(%rbp), %rdi
callq 0x6c860
leaq -0x468(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x2a4(%rbp)
jmp 0x1ad4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1ad33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x6c860
leaq -0x468(%rbp), %rdi
callq 0x1c540
jmp 0x1ae8c
movl $0x0, -0x2a4(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x1c560
movl -0x2a4(%rbp), %eax
testl %eax, %eax
jne 0x1afc5
jmp 0x1ad6a
leaq -0x590(%rbp), %rdi
callq 0x1cc70
jmp 0x1ad78
leaq 0x20b1(%rip), %rax      # 0x1ce30
movq %rax, -0x5a0(%rbp)
movq $0x0, -0x598(%rbp)
leaq -0x430(%rbp), %rdi
xorl %esi, %esi
leaq -0x5a0(%rbp), %rdx
leaq -0x590(%rbp), %rcx
callq 0x1d030
jmp 0x1adaf
leaq 0x207a(%rip), %rax      # 0x1ce30
movq %rax, -0x5b0(%rbp)
movq $0x0, -0x5a8(%rbp)
leaq -0x590(%rbp), %rax
movq %rax, -0x5b8(%rbp)
leaq -0x430(%rbp), %rdi
xorl %esi, %esi
leaq -0x5b0(%rbp), %rdx
leaq -0x5b8(%rbp), %rcx
callq 0x1d070
jmp 0x1adf4
movl $0x1, -0x5bc(%rbp)
leaq -0x430(%rbp), %rdi
leaq -0x5bc(%rbp), %rsi
callq 0x1cec0
jmp 0x1ae13
leaq -0x590(%rbp), %rdi
callq 0x1d0b0
movl %eax, -0x644(%rbp)
jmp 0x1ae27
movl -0x644(%rbp), %eax
movl %eax, -0x5d4(%rbp)
movl $0x2, -0x5d8(%rbp)
leaq 0x8aac6(%rip), %rsi     # 0xa590a
leaq 0x8aab3(%rip), %rdx     # 0xa58fe
leaq -0x5d0(%rbp), %rdi
leaq -0x5d4(%rbp), %rcx
leaq -0x5d8(%rbp), %r8
callq 0x1cef0
jmp 0x1ae67
leaq -0x5d0(%rbp), %rdi
callq 0x1c500
movb %al, -0x645(%rbp)
jmp 0x1ae7b
movb -0x645(%rbp), %al
testb $0x1, %al
jne 0x1ae87
jmp 0x1aecb
jmp 0x1af8d
leaq -0x458(%rbp), %rdi
callq 0x1c560
jmp 0x1b00a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1affe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1aff2
leaq -0x5e0(%rbp), %rdi
callq 0x6f130
jmp 0x1aed9
leaq -0x5d0(%rbp), %rdi
callq 0x1c520
movq %rax, -0x650(%rbp)
jmp 0x1aeee
movq -0x650(%rbp), %r8
leaq 0x8a7af(%rip), %rdx     # 0xa56ab
leaq -0x5e8(%rbp), %rdi
movl $0x2, %esi
movl $0x12f, %ecx            # imm = 0x12F
callq 0x6c7e0
jmp 0x1af14
leaq -0x5e8(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0x6c8a0
jmp 0x1af29
leaq -0x5e8(%rbp), %rdi
callq 0x6c860
leaq -0x5e0(%rbp), %rdi
callq 0x1c540
movl $0x1, -0x2a4(%rbp)
jmp 0x1af97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
jmp 0x1af7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x258(%rbp)
movl %eax, -0x25c(%rbp)
leaq -0x5e8(%rbp), %rdi
callq 0x6c860
leaq -0x5e0(%rbp), %rdi
callq 0x1c540
jmp 0x1aff2
movl $0x0, -0x2a4(%rbp)
leaq -0x5d0(%rbp), %rdi
callq 0x1c560
movl -0x2a4(%rbp), %eax
testl %eax, %eax
jne 0x1afb9
jmp 0x1afaf
movl $0x0, -0x2a4(%rbp)
leaq -0x590(%rbp), %rdi
callq 0x1d0d0
leaq -0x430(%rbp), %rdi
callq 0x1d0f0
leaq -0x240(%rbp), %rdi
callq 0x1d0f0
leaq -0x128(%rbp), %rdi
callq 0x1d0d0
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
leaq -0x5d0(%rbp), %rdi
callq 0x1c560
leaq -0x590(%rbp), %rdi
callq 0x1d0d0
leaq -0x430(%rbp), %rdi
callq 0x1d0f0
leaq -0x240(%rbp), %rdi
callq 0x1d0f0
leaq -0x128(%rbp), %rdi
callq 0x1d0d0
movq -0x258(%rbp), %rdi
callq 0xdcb0
nopw (%rax,%rax)