use github repo as central
This commit is contained in:
22
test/core/runnable_ut.cc
Normal file
22
test/core/runnable_ut.cc
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "alibabacloud/core/Runnable.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace AlibabaCloud;
|
||||
|
||||
|
||||
static int nbr = 0;
|
||||
void foo() {
|
||||
nbr = 1;
|
||||
}
|
||||
|
||||
// there should be no exception
|
||||
TEST(Runnable, basic) {
|
||||
std::function<void()> func(foo);
|
||||
Runnable f(func);
|
||||
EXPECT_TRUE(nbr == 0);
|
||||
f.run();
|
||||
EXPECT_TRUE(nbr == 1);
|
||||
}
|
||||
Reference in New Issue
Block a user