
migrating talk/base to webrtc/base. BUG=N/A R=niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/17479005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6129 4adac7df-926f-26a2-2b94-8c16560cd09d
38 lines
1.1 KiB
C++
Executable File
38 lines
1.1 KiB
C++
Executable File
/*
|
|
* Copyright 2014 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#include "webrtc/base/genericslot.h"
|
|
#include "webrtc/base/gunit.h"
|
|
#include "webrtc/base/sigslot.h"
|
|
|
|
namespace rtc {
|
|
|
|
TEST(GenericSlotTest, TestSlot1) {
|
|
sigslot::signal1<int> source1;
|
|
GenericSlot1<int> slot1(&source1, 1);
|
|
EXPECT_FALSE(slot1.callback_received());
|
|
source1.emit(10);
|
|
EXPECT_TRUE(slot1.callback_received());
|
|
EXPECT_EQ(10, slot1.arg1());
|
|
}
|
|
|
|
TEST(GenericSlotTest, TestSlot2) {
|
|
sigslot::signal2<int, char> source2;
|
|
GenericSlot2<int, char> slot2(&source2, 1, '0');
|
|
EXPECT_FALSE(slot2.callback_received());
|
|
source2.emit(10, 'x');
|
|
EXPECT_TRUE(slot2.callback_received());
|
|
EXPECT_EQ(10, slot2.arg1());
|
|
EXPECT_EQ('x', slot2.arg2());
|
|
}
|
|
|
|
// By induction we assume the rest work too...
|
|
|
|
} // namespace rtc
|