MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / TEST_NAME

Function TEST_NAME

test/variant_modulo_test.cpp:38–325  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

36
37////////////////////////////////////////////////////////////////////////////////
38int TEST_NAME(int, char**) {
39 UnitTest t(40);
40
41 Variant v0(true);
42 Variant v1(42);
43 Variant v2(3.14);
44 Variant v3("foo");
45 Variant v4(1234567890, Variant::type_date);
46 Variant v5(1200, Variant::type_duration);
47
48 // boolean / boolean -> ERROR
49 try {
50 Variant v00 = v0 % v0;
51 t.fail("true % true --> error");
52 } catch (...) {
53 t.pass("true % true --> error");
54 }
55
56 // boolean / integer -> ERROR
57 try {
58 Variant v01 = v0 % v1;
59 t.fail("true % 42 --> error");
60 } catch (...) {
61 t.pass("true % 42 --> error");
62 }
63
64 // boolean / real -> ERROR
65 try {
66 Variant v02 = v0 % v2;
67 t.fail("true % 3.14 --> error");
68 } catch (...) {
69 t.pass("true % 3.14 --> error");
70 }
71
72 // boolean / string -> ERROR
73 try {
74 Variant v03 = v0 % v3;
75 t.fail("true % foo --> error");
76 } catch (...) {
77 t.pass("true % foo --> error");
78 }
79
80 // boolean / date -> ERROR
81 try {
82 Variant v04 = v0 % v4;
83 t.fail("true % 1234567890 --> error");
84 } catch (...) {
85 t.pass("true % 1234567890 --> error");
86 }
87
88 // boolean / duration -> ERROR
89 try {
90 Variant v05 = v0 % v5;
91 t.fail("true % 1200 --> error");
92 } catch (...) {
93 t.pass("true % 1200 --> error");
94 }
95

Callers

nothing calls this directly

Calls 6

failMethod · 0.80
passMethod · 0.80
isMethod · 0.80
typeMethod · 0.80
get_integerMethod · 0.80
get_realMethod · 0.80

Tested by

no test coverage detected