@@ -38,26 +38,31 @@ TEST(LlvmLibcStringConverterTest, UTF8To32) {
3838 ASSERT_TRUE (res.has_value ());
3939 ASSERT_EQ (static_cast <int >(res.value ()), 0x1f921 );
4040 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 4 );
41+ ASSERT_FALSE (sc.isConversionComplete ());
4142
4243 res = sc.popUTF32 ();
4344 ASSERT_TRUE (res.has_value ());
4445 ASSERT_EQ (static_cast <int >(res.value ()), 0x2211 );
4546 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 7 );
47+ ASSERT_FALSE (sc.isConversionComplete ());
4648
4749 res = sc.popUTF32 ();
4850 ASSERT_TRUE (res.has_value ());
4951 ASSERT_EQ (static_cast <int >(res.value ()), 0xff );
5052 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 9 );
53+ ASSERT_FALSE (sc.isConversionComplete ());
5154
5255 res = sc.popUTF32 ();
5356 ASSERT_TRUE (res.has_value ());
5457 ASSERT_EQ (static_cast <int >(res.value ()), 0x41 );
5558 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 10 );
59+ ASSERT_FALSE (sc.isConversionComplete ());
5660
5761 res = sc.popUTF32 ();
5862 ASSERT_TRUE (res.has_value ());
5963 ASSERT_EQ (static_cast <int >(res.value ()), 0 );
6064 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 11 );
65+ ASSERT_TRUE (sc.isConversionComplete ());
6166
6267 res = sc.popUTF32 ();
6368 ASSERT_FALSE (res.has_value ());
@@ -79,60 +84,71 @@ TEST(LlvmLibcStringConverterTest, UTF32To8) {
7984 ASSERT_TRUE (res.has_value ());
8085 ASSERT_EQ (static_cast <int >(res.value ()), 0xF0 );
8186 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 1 );
87+ ASSERT_FALSE (sc.isConversionComplete ());
8288
8389 res = sc.popUTF8 ();
8490 ASSERT_TRUE (res.has_value ());
8591 ASSERT_EQ (static_cast <int >(res.value ()), 0x9F );
8692 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 1 );
93+ ASSERT_FALSE (sc.isConversionComplete ());
8794
8895 res = sc.popUTF8 ();
8996 ASSERT_TRUE (res.has_value ());
9097 ASSERT_EQ (static_cast <int >(res.value ()), 0xA4 );
9198 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 1 );
99+ ASSERT_FALSE (sc.isConversionComplete ());
92100
93101 res = sc.popUTF8 ();
94102 ASSERT_TRUE (res.has_value ());
95103 ASSERT_EQ (static_cast <int >(res.value ()), 0xA1 );
96104 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 1 );
105+ ASSERT_FALSE (sc.isConversionComplete ());
97106
98107 // end of clown emoji, sigma symbol begins
99108 res = sc.popUTF8 ();
100109 ASSERT_TRUE (res.has_value ());
101110 ASSERT_EQ (static_cast <int >(res.value ()), 0xE2 );
102111 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 2 );
112+ ASSERT_FALSE (sc.isConversionComplete ());
103113
104114 res = sc.popUTF8 ();
105115 ASSERT_TRUE (res.has_value ());
106116 ASSERT_EQ (static_cast <int >(res.value ()), 0x88 );
107117 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 2 );
118+ ASSERT_FALSE (sc.isConversionComplete ());
108119
109120 res = sc.popUTF8 ();
110121 ASSERT_TRUE (res.has_value ());
111122 ASSERT_EQ (static_cast <int >(res.value ()), 0x91 );
112123 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 2 );
124+ ASSERT_FALSE (sc.isConversionComplete ());
113125
114126 // end of sigma symbol, y with diaeresis begins
115127 res = sc.popUTF8 ();
116128 ASSERT_TRUE (res.has_value ());
117129 ASSERT_EQ (static_cast <int >(res.value ()), 0xC3 );
118130 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 3 );
131+ ASSERT_FALSE (sc.isConversionComplete ());
119132
120133 res = sc.popUTF8 ();
121134 ASSERT_TRUE (res.has_value ());
122135 ASSERT_EQ (static_cast <int >(res.value ()), 0xBF );
123136 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 3 );
137+ ASSERT_FALSE (sc.isConversionComplete ());
124138
125139 // end of y with diaeresis, letter A begins
126140 res = sc.popUTF8 ();
127141 ASSERT_TRUE (res.has_value ());
128142 ASSERT_EQ (static_cast <int >(res.value ()), 0x41 );
129143 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 4 );
144+ ASSERT_FALSE (sc.isConversionComplete ());
130145
131146 // null byte
132147 res = sc.popUTF8 ();
133148 ASSERT_TRUE (res.has_value ());
134149 ASSERT_EQ (static_cast <int >(res.value ()), 0 );
135150 ASSERT_EQ (static_cast <int >(sc.getSourceIndex ()), 5 );
151+ ASSERT_TRUE (sc.isConversionComplete ());
136152
137153 res = sc.popUTF8 ();
138154 ASSERT_FALSE (res.has_value ());
0 commit comments