File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ namespace proxy_wasm {
24
24
struct Word {
25
25
Word (uint64_t w) : u64_(w) {} // Implicit conversion into Word.
26
26
uint32_t u32 () const { return static_cast <uint32_t >(u64_); }
27
+ operator uint64_t () const { return u64_; }
27
28
uint64_t u64_;
28
29
};
29
30
Original file line number Diff line number Diff line change 5
5
namespace proxy_wasm {
6
6
namespace {
7
7
8
- TEST (WasmVm, Load ) {
8
+ TEST (WasmVm, Compat ) {
9
9
string_view foo = " foo" ;
10
10
std::string bar = " bar" ;
11
11
12
12
EXPECT_NE (foo, bar);
13
13
EXPECT_EQ (foo, " foo" );
14
+
15
+ optional<int > o = PROXY_WASM_NULLOPT;
16
+ EXPECT_FALSE (o);
17
+
18
+ o = 1 ;
19
+ EXPECT_TRUE (o);
20
+ }
21
+
22
+ TEST (WasmVm, Word) {
23
+ Word w (1 );
24
+ EXPECT_EQ (w.u32 (), 1 );
25
+ EXPECT_EQ (sizeof (w.u32 ()), sizeof (uint32_t ));
26
+ EXPECT_EQ (w, 1 );
27
+ EXPECT_EQ (sizeof (w), sizeof (uint64_t ));
14
28
}
15
29
16
30
} // namespace
You can’t perform that action at this time.
0 commit comments