Adds a modified copy of talk/base to webrtc/base. It is the first step in migrating talk/base to webrtc/base.
BUG=N/A R=andrew@webrtc.org, wu@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12199004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6107 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
37
webrtc/base/genericslot_unittest.cc
Executable file
37
webrtc/base/genericslot_unittest.cc
Executable file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user