• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "rxcpp/rx.hpp"
2 
3 #include "rxcpp/rx-test.hpp"
4 #include "catch.hpp"
5 
6 SCENARIO("empty sample"){
7     printf("//! [empty sample]\n");
8     auto values = rxcpp::observable<>::empty<int>();
9     values.
10         subscribe(
__anon63d88c200102(int v)11             [](int v){printf("OnNext: %d\n", v);},
__anon63d88c200202()12             [](){printf("OnCompleted\n");});
13     printf("//! [empty sample]\n");
14 }
15 
16 SCENARIO("threaded empty sample"){
17     printf("//! [threaded empty sample]\n");
18     auto values = rxcpp::observable<>::empty<int>(rxcpp::observe_on_event_loop());
19     values.
20         as_blocking().
21         subscribe(
__anon63d88c200302(int v)22             [](int v){printf("OnNext: %d\n", v);},
__anon63d88c200402()23             [](){printf("OnCompleted\n");});
24     printf("//! [threaded empty sample]\n");
25 }
26 
27 SCENARIO("empty operator syntax sample"){
28     using namespace rxcpp::sources;
29 
30     printf("//! [empty operator syntax sample]\n");
31     auto values = empty<int>();
32     values.
33             subscribe(
__anon63d88c200502(int v)34             [](int v){printf("OnNext: %d\n", v);},
__anon63d88c200602()35             [](){printf("OnCompleted\n");});
36     printf("//! [empty operator syntax sample]\n");
37 }
38