Home | History | Annotate | Download | only in glue

Lines Matching defs:cpp

178   CppVariant cpp;
180 cpp.Set(true);
181 cpp.CopyToNPVariant(&np);
182 EXPECT_EQ(cpp.type, np.type);
183 EXPECT_EQ(cpp.value.boolValue, np.value.boolValue);
186 cpp.Set(17);
187 cpp.CopyToNPVariant(&np);
188 EXPECT_EQ(cpp.type, np.type);
189 EXPECT_EQ(cpp.value.intValue, np.value.intValue);
192 cpp.Set(3.1415);
193 cpp.CopyToNPVariant(&np);
194 EXPECT_EQ(cpp.type, np.type);
195 EXPECT_EQ(cpp.value.doubleValue, np.value.doubleValue);
198 cpp.Set("test value");
199 cpp.CopyToNPVariant(&np);
203 cpp.SetNull();
204 cpp.CopyToNPVariant(&np);
205 EXPECT_EQ(cpp.type, np.type);
209 cpp.Set(object);
210 cpp.CopyToNPVariant(&np);
212 cpp.SetNull();
219 CppVariant cpp;
222 cpp.Set(np);
223 EXPECT_EQ(np.type, cpp.type);
227 cpp.Set(np);
228 EXPECT_EQ(np.type, cpp.type);
232 cpp.Set(np);
233 EXPECT_EQ(np.type, cpp.type);
234 EXPECT_EQ(np.value.boolValue, cpp.value.boolValue);
238 cpp.Set(np);
239 EXPECT_EQ(np.type, cpp.type);
240 EXPECT_EQ(np.value.intValue, cpp.value.intValue);
244 cpp.Set(np);
245 EXPECT_EQ(np.type, cpp.type);
246 EXPECT_EQ(np.value.doubleValue, cpp.value.doubleValue);
252 cpp.Set(np);
253 CheckString("1st test value", cpp);
263 cpp.Set(np);
264 CheckString("\xce\xb1\xe4\xb8\x80\xf0\x90\x90\x84", cpp);
269 cpp.Set(np);
272 CheckObject(cpp);
276 CppVariant cpp;
277 cpp.Set(true);
278 EXPECT_EQ(NPVariantType_Bool, cpp.type);
279 EXPECT_TRUE(cpp.value.boolValue);
281 cpp.Set(5);
282 EXPECT_EQ(NPVariantType_Int32, cpp.type);
283 EXPECT_EQ(5, cpp.value.intValue);
285 cpp.Set(1.234);
286 EXPECT_EQ(NPVariantType_Double, cpp.type);
287 EXPECT_EQ(1.234, cpp.value.doubleValue);
290 cpp.Set("1st test string");
291 CheckString("1st test string", cpp);
295 cpp.Set(source);
296 CheckString("std test string", cpp);
301 cpp.Set(np_ascii_str);
303 CheckString(expected, cpp);
311 cpp.Set(np_intl_str);
313 CheckString(expected, cpp);
316 cpp.Set(obj);
318 CheckObject(cpp);
322 CppVariant cpp;
323 EXPECT_EQ(NPVariantType_Null, cpp.type);
324 cpp.Set(12);
325 EXPECT_EQ(NPVariantType_Int32, cpp.type);
326 cpp.FreeData();
327 EXPECT_EQ(NPVariantType_Void, cpp.type);
331 CppVariant cpp;
333 cpp.Set(object);
335 cpp.FreeData();
339 cpp.Set(object);
342 cpp.FreeData();
347 CppVariant cpp;
351 VOID_TO_NPVARIANT(cpp);
352 EXPECT_FALSE(cpp.isBool());
353 EXPECT_FALSE(cpp.isInt32());
354 EXPECT_FALSE(cpp.isDouble());
355 EXPECT_FALSE(cpp.isNumber());
356 EXPECT_FALSE(cpp.isString());
357 EXPECT_TRUE(cpp.isVoid());
358 EXPECT_FALSE(cpp.isNull());
359 EXPECT_TRUE(cpp.isEmpty());
361 cpp.Set(true);
362 EXPECT_TRUE(cpp.isBool());
363 EXPECT_FALSE(cpp.isInt32());
364 EXPECT_FALSE(cpp.isDouble());
365 EXPECT_FALSE(cpp.isNumber());
366 EXPECT_FALSE(cpp.isString());
367 EXPECT_FALSE(cpp.isVoid());
368 EXPECT_FALSE(cpp.isNull());
369 EXPECT_FALSE(cpp.isEmpty());
370 EXPECT_FALSE(cpp.isObject());
372 cpp.Set(12);
373 EXPECT_FALSE(cpp.isBool());
374 EXPECT_TRUE(cpp.isInt32());
375 EXPECT_FALSE(cpp.isDouble());
376 EXPECT_TRUE(cpp.isNumber());
377 EXPECT_FALSE(cpp.isString());
378 EXPECT_FALSE(cpp.isVoid());
379 EXPECT_FALSE(cpp.isNull());
380 EXPECT_FALSE(cpp.isEmpty());
381 EXPECT_FALSE(cpp.isObject());
383 cpp.Set(3.1415);
384 EXPECT_FALSE(cpp.isBool());
385 EXPECT_FALSE(cpp.isInt32());
386 EXPECT_TRUE(cpp.isDouble());
387 EXPECT_TRUE(cpp.isNumber());
388 EXPECT_FALSE(cpp.isString());
389 EXPECT_FALSE(cpp.isVoid());
390 EXPECT_FALSE(cpp.isNull());
391 EXPECT_FALSE(cpp.isEmpty());
392 EXPECT_FALSE(cpp.isObject());
394 cpp.Set("a string");
395 EXPECT_FALSE(cpp.isBool());
396 EXPECT_FALSE(cpp.isInt32());
397 EXPECT_FALSE(cpp.isDouble());
398 EXPECT_FALSE(cpp.isNumber());
399 EXPECT_TRUE(cpp.isString());
400 EXPECT_FALSE(cpp.isVoid());
401 EXPECT_FALSE(cpp.isNull());
402 EXPECT_FALSE(cpp.isEmpty());
403 EXPECT_FALSE(cpp.isObject());
405 cpp.SetNull();
406 EXPECT_FALSE(cpp.isBool());
407 EXPECT_FALSE(cpp.isInt32());
408 EXPECT_FALSE(cpp.isDouble());
409 EXPECT_FALSE(cpp.isNumber());
410 EXPECT_FALSE(cpp.isString());
411 EXPECT_FALSE(cpp.isVoid());
412 EXPECT_TRUE(cpp.isNull());
413 EXPECT_TRUE(cpp.isEmpty());
414 EXPECT_FALSE(cpp.isObject());
417 cpp.Set(obj);
418 EXPECT_FALSE(cpp.isBool());
419 EXPECT_FALSE(cpp.isInt32());
420 EXPECT_FALSE(cpp.isDouble());
421 EXPECT_FALSE(cpp.isNumber());
422 EXPECT_FALSE(cpp.isString());
423 EXPECT_FALSE(cpp.isVoid());
424 EXPECT_FALSE(cpp.isNull());
425 EXPECT_FALSE(cpp.isEmpty());
426 EXPECT_TRUE(cpp.isObject());
428 CheckObject(cpp);
475 CppVariant cpp;
476 cpp.Set(obj);
478 std::vector<CppVariant> cpp_vector = cpp.ToVector();