| Flutter Linux Embedder |

Functions
fl_value_test.cc File Reference
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"`
`#include <gmodule.h>`
`#include <cmath>`
`#include "gtest/gtest.h"`

Go to the source code of this file.

## Functions
| TEST (FlDartProjectTest, Null)
| TEST (FlValueTest, NullEqual)
| TEST (FlValueTest, NullToString)
| TEST (FlValueTest, BoolTrue)
| TEST (FlValueTest, BoolFalse)
| TEST (FlValueTest, BoolEqual)
| TEST (FlValueTest, BoolNotEqual)
| TEST (FlValueTest, BoolTrueToString)
| TEST (FlValueTest, BoolFalseToString)
| TEST (FlValueTest, IntZero)
| TEST (FlValueTest, IntOne)
| TEST (FlValueTest, IntMinusOne)
| TEST (FlValueTest, IntMin)
| TEST (FlValueTest, IntMax)
| TEST (FlValueTest, IntEqual)
| TEST (FlValueTest, IntNotEqual)
| TEST (FlValueTest, IntToString)
| TEST (FlValueTest, FloatZero)
| TEST (FlValueTest, FloatOne)
| TEST (FlValueTest, FloatMinusOne)
| TEST (FlValueTest, FloatPi)
| TEST (FlValueTest, FloatEqual)
| TEST (FlValueTest, FloatNotEqual)
| TEST (FlValueTest, FloatToString)
| TEST (FlValueTest, String)
| TEST (FlValueTest, StringEmpty)
| TEST (FlValueTest, StringSized)
| TEST (FlValueTest, StringSizedNullptr)
| TEST (FlValueTest, StringSizedZeroLength)
| TEST (FlValueTest, StringEqual)
| TEST (FlValueTest, StringNotEqual)
| TEST (FlValueTest, StringToString)
| TEST (FlValueTest, Uint8List)
| TEST (FlValueTest, Uint8ListNullptr)
| TEST (FlValueTest, Uint8ListEqual)
| TEST (FlValueTest, Uint8ListEmptyEqual)
| TEST (FlValueTest, Uint8ListNotEqualSameSize)
| TEST (FlValueTest, Uint8ListNotEqualDifferentSize)
| TEST (FlValueTest, Uint8ListEmptyNotEqual)
| TEST (FlValueTest, Uint8ListToString)
| TEST (FlValueTest, Int32List)
| TEST (FlValueTest, Int32ListNullptr)
| TEST (FlValueTest, Int32ListEqual)
| TEST (FlValueTest, Int32ListEmptyEqual)
| TEST (FlValueTest, Int32ListNotEqualSameSize)
| TEST (FlValueTest, Int32ListNotEqualDifferentSize)
| TEST (FlValueTest, Int32ListEmptyNotEqual)
| TEST (FlValueTest, Int32ListToString)
| TEST (FlValueTest, Int64List)
| TEST (FlValueTest, Int64ListNullptr)
| TEST (FlValueTest, Int64ListEqual)
| TEST (FlValueTest, Int64ListEmptyEqual)
| TEST (FlValueTest, Int64ListNotEqualSameSize)
| TEST (FlValueTest, Int64ListNotEqualDifferentSize)
| TEST (FlValueTest, Int64ListEmptyNotEqual)
| TEST (FlValueTest, Int64ListToString)
| TEST (FlValueTest, FloatList)
| TEST (FlValueTest, FloatListNullptr)
| TEST (FlValueTest, FloatListEqual)
| TEST (FlValueTest, FloatListEmptyEqual)
| TEST (FlValueTest, FloatListNotEqualSameSize)
| TEST (FlValueTest, FloatListNotEqualDifferentSize)
| TEST (FlValueTest, FloatListEmptyNotEqual)
| TEST (FlValueTest, FloatListToString)
| TEST (FlValueTest, ListEmpty)
| TEST (FlValueTest, ListAdd)
| TEST (FlValueTest, ListAddTake)
| TEST (FlValueTest, ListChildTypes)
| TEST (FlValueTest, ListStrv)
| TEST (FlValueTest, ListStrvEmpty)
| TEST (FlValueTest, ListEqual)
| TEST (FlValueTest, ListEmptyEqual)
| TEST (FlValueTest, ListNotEqualSameSize)
| TEST (FlValueTest, ListNotEqualDifferentSize)
| TEST (FlValueTest, ListEmptyNotEqual)
| TEST (FlValueTest, ListToString)
| TEST (FlValueTest, MapEmpty)
| TEST (FlValueTest, MapSet)
| TEST (FlValueTest, MapSetTake)
| TEST (FlValueTest, MapSetString)
| TEST (FlValueTest, MapSetStringTake)
| TEST (FlValueTest, MapLookup)
| TEST (FlValueTest, MapLookupString)
| TEST (FlValueTest, MapValueypes)
| TEST (FlValueTest, MapKeyTypes)
| TEST (FlValueTest, MapEqual)
| TEST (FlValueTest, MapEqualDifferentOrder)
| TEST (FlValueTest, MapEmptyEqual)
| TEST (FlValueTest, MapNotEqualSameSizeDifferentKeys)
| TEST (FlValueTest, MapNotEqualSameSizeDifferentValues)
| TEST (FlValueTest, MapNotEqualDifferentSize)
| TEST (FlValueTest, MapEmptyNotEqual)
| TEST (FlValueTest, MapToString)
| TEST (FlDartProjectTest, Custom)
| TEST (FlDartProjectTest, CustomNoDestroyNotify)
| TEST (FlDartProjectTest, CustomObject)
| TEST (FlDartProjectTest, CustomObjectTake)
| TEST (FlValueTest, CustomEqual)
| TEST (FlValueTest, CustomToString)
| TEST (FlValueTest, EqualSameObject)
| TEST (FlValueTest, NullIntNotEqual)
| TEST (FlValueTest, NullBoolNotEqual)
| TEST (FlValueTest, StringUint8ListNotEqual)
| TEST (FlValueTest, Uint8ListInt32ListNotEqual)
| TEST (FlValueTest, Int32ListInt64ListNotEqual)
| TEST (FlValueTest, Int64ListFloatListNotEqual)
| TEST (FlValueTest, ListMapNotEqual)

## Function Documentation

## ◆ TEST() [1/107]

TEST | ( | FlDartProjectTest | ,
|  | Custom |
| ) |  |

Definition at line 889 of file fl_value_test.cc.

889 {
890 g_autoptr(FlValue) value =
891 fl_value_new_custom(128, g_strdup("Hello World"), g_free);
892 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
893 ASSERT_EQ(fl_value_get_custom_type(value), 128);
894 ASSERT_STREQ(reinterpret_cast<const gchar*>(fl_value_get_custom_value(value)),
895 "Hello World");
896 }
value
uint8_t value
Definition: fl_standard_message_codec.cc:36
fl_value_new_custom
G_MODULE_EXPORT FlValue * fl_value_new_custom(int type, gconstpointer value, GDestroyNotify destroy_notify)
Definition: fl_value.cc:374
fl_value_get_type
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:466
fl_value_get_custom_type
G_MODULE_EXPORT int fl_value_get_custom_type(FlValue *self)
Definition: fl_value.cc:822
fl_value_get_custom_value
G_MODULE_EXPORT gconstpointer fl_value_get_custom_value(FlValue *self)
Definition: fl_value.cc:830
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
FL_VALUE_TYPE_CUSTOM
@ FL_VALUE_TYPE_CUSTOM
Definition: fl_value.h:76

References fl_value_get_custom_type(), fl_value_get_custom_value(), fl_value_get_type(), fl_value_new_custom(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [2/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomNoDestroyNotify |
| ) |  |

Definition at line 898 of file fl_value_test.cc.

898 {
899 g_autoptr(FlValue) value = fl_value_new_custom(128, "Hello World", nullptr);
900 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
901 ASSERT_EQ(fl_value_get_custom_type(value), 128);
902 ASSERT_STREQ(reinterpret_cast<const gchar*>(fl_value_get_custom_value(value)),
903 "Hello World");
904 }

References fl_value_get_custom_type(), fl_value_get_custom_value(), fl_value_get_type(), fl_value_new_custom(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [3/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomObject |
| ) |  |

Definition at line 906 of file fl_value_test.cc.

906 {
907 g_autoptr(GObject) v = G_OBJECT(g_object_new(G_TYPE_OBJECT, nullptr));
908 g_autoptr(FlValue) value = fl_value_new_custom_object(128, v);
909 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
910 ASSERT_EQ(fl_value_get_custom_type(value), 128);
911 ASSERT_TRUE(G_IS_OBJECT(fl_value_get_custom_value_object(value)));
912 }
fl_value_new_custom_object
G_MODULE_EXPORT FlValue * fl_value_new_custom_object(int type, GObject *object)
Definition: fl_value.cc:385
fl_value_get_custom_value_object
G_MODULE_EXPORT GObject * fl_value_get_custom_value_object(FlValue *self)
Definition: fl_value.cc:838

References fl_value_get_custom_type(), fl_value_get_custom_value_object(), fl_value_get_type(), fl_value_new_custom_object(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [4/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomObjectTake |
| ) |  |

Definition at line 914 of file fl_value_test.cc.

914 {
915 g_autoptr(FlValue) value = fl_value_new_custom_object_take(
916 128, G_OBJECT(g_object_new(G_TYPE_OBJECT, nullptr)));
917 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
918 ASSERT_EQ(fl_value_get_custom_type(value), 128);
919 ASSERT_TRUE(G_IS_OBJECT(fl_value_get_custom_value_object(value)));
920 }
fl_value_new_custom_object_take
G_MODULE_EXPORT FlValue * fl_value_new_custom_object_take(int type, GObject *object)
Definition: fl_value.cc:389

References fl_value_get_custom_type(), fl_value_get_custom_value_object(), fl_value_get_type(), fl_value_new_custom_object_take(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [5/107]

TEST | ( | FlDartProjectTest | ,
|  | Null |
| ) |  |

Definition at line 12 of file fl_value_test.cc.

12 {
13 g_autoptr(FlValue) value = fl_value_new_null();
14 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_NULL);
15 }
fl_value_new_null
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:251
FL_VALUE_TYPE_NULL
@ FL_VALUE_TYPE_NULL
Definition: fl_value.h:64

References fl_value_get_type(), fl_value_new_null(), FL_VALUE_TYPE_NULL, and value.

## ◆ TEST() [6/107]

TEST | ( | FlValueTest | ,
|  | BoolEqual |
| ) |  |

Definition at line 41 of file fl_value_test.cc.

41 {
42 g_autoptr(FlValue) value1 = fl_value_new_bool(TRUE);
43 g_autoptr(FlValue) value2 = fl_value_new_bool(TRUE);
44 EXPECT_TRUE(fl_value_equal(value1, value2));
45 }
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
fl_value_new_bool
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:255
fl_value_equal
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:471

References fl_value_equal(), fl_value_new_bool(), and TRUE.

## ◆ TEST() [7/107]

TEST | ( | FlValueTest | ,
|  | BoolFalse |
| ) |  |

Definition at line 35 of file fl_value_test.cc.

35 {
36 g_autoptr(FlValue) value = fl_value_new_bool(FALSE);
37 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_BOOL);
38 EXPECT_FALSE(fl_value_get_bool(value));
39 }
fl_value_get_bool
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:661
FL_VALUE_TYPE_BOOL
@ FL_VALUE_TYPE_BOOL
Definition: fl_value.h:65

References fl_value_get_bool(), fl_value_get_type(), fl_value_new_bool(), FL_VALUE_TYPE_BOOL, and value.

## ◆ TEST() [8/107]

TEST | ( | FlValueTest | ,
|  | BoolFalseToString |
| ) |  |

Definition at line 59 of file fl_value_test.cc.

59 {
60 g_autoptr(FlValue) value = fl_value_new_bool(FALSE);
61 g_autofree gchar* text = fl_value_to_string(value);
62 EXPECT_STREQ(text, "false");
63 }
fl_value_to_string
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:846

References fl_value_new_bool(), fl_value_to_string(), and value.

## ◆ TEST() [9/107]

TEST | ( | FlValueTest | ,
|  | BoolNotEqual |
| ) |  |

Definition at line 47 of file fl_value_test.cc.

47 {
48 g_autoptr(FlValue) value1 = fl_value_new_bool(TRUE);
49 g_autoptr(FlValue) value2 = fl_value_new_bool(FALSE);
50 EXPECT_FALSE(fl_value_equal(value1, value2));
51 }

References fl_value_equal(), fl_value_new_bool(), and TRUE.

## ◆ TEST() [10/107]

TEST | ( | FlValueTest | ,
|  | BoolTrue |
| ) |  |

Definition at line 29 of file fl_value_test.cc.

29 {
30 g_autoptr(FlValue) value = fl_value_new_bool(TRUE);
31 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_BOOL);
32 EXPECT_TRUE(fl_value_get_bool(value));
33 }

References fl_value_get_bool(), fl_value_get_type(), fl_value_new_bool(), FL_VALUE_TYPE_BOOL, TRUE, and value.

## ◆ TEST() [11/107]

TEST | ( | FlValueTest | ,
|  | BoolTrueToString |
| ) |  |

Definition at line 53 of file fl_value_test.cc.

53 {
54 g_autoptr(FlValue) value = fl_value_new_bool(TRUE);
55 g_autofree gchar* text = fl_value_to_string(value);
56 EXPECT_STREQ(text, "true");
57 }

References fl_value_new_bool(), fl_value_to_string(), TRUE, and value.

## ◆ TEST() [12/107]

TEST | ( | FlValueTest | ,
|  | CustomEqual |
| ) |  |

Definition at line 922 of file fl_value_test.cc.

922 {
923 g_autoptr(FlValue) value1 = fl_value_new_custom(128, "Hello World", nullptr);
924 g_autoptr(FlValue) value2 = fl_value_new_custom(128, "Hello World", nullptr);
925 EXPECT_FALSE(fl_value_equal(value1, value2));
926 }

References fl_value_equal(), and fl_value_new_custom().

## ◆ TEST() [13/107]

TEST | ( | FlValueTest | ,
|  | CustomToString |
| ) |  |

Definition at line 928 of file fl_value_test.cc.

928 {
929 g_autoptr(FlValue) value = fl_value_new_custom(128, nullptr, nullptr);
930 g_autofree gchar* text = fl_value_to_string(value);
931 EXPECT_STREQ(text, "(custom 128)");
932 }

References fl_value_new_custom(), fl_value_to_string(), and value.

## ◆ TEST() [14/107]

TEST | ( | FlValueTest | ,
|  | EqualSameObject |
| ) |  |

Definition at line 934 of file fl_value_test.cc.

934 {
935 g_autoptr(FlValue) value = fl_value_new_null();
936 EXPECT_TRUE(fl_value_equal(value, value));
937 }

References fl_value_equal(), fl_value_new_null(), and value.

## ◆ TEST() [15/107]

TEST | ( | FlValueTest | ,
|  | FloatEqual |
| ) |  |

Definition at line 137 of file fl_value_test.cc.

137 {
138 g_autoptr(FlValue) value1 = fl_value_new_float(M_PI);
139 g_autoptr(FlValue) value2 = fl_value_new_float(M_PI);
140 EXPECT_TRUE(fl_value_equal(value1, value2));
141 }
fl_value_new_float
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:269

References fl_value_equal(), and fl_value_new_float().

## ◆ TEST() [16/107]

TEST | ( | FlValueTest | ,
|  | FloatList |
| ) |  |

Definition at line 386 of file fl_value_test.cc.

386 {
387 double data[] = {0.0, -1.0, M_PI};
388 g_autoptr(FlValue) value = fl_value_new_float_list(data, 3);
389 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT_LIST);
390 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(3));
391 EXPECT_EQ(fl_value_get_float_list(value)[0], 0);
392 EXPECT_EQ(fl_value_get_float_list(value)[1], -1.0);
393 EXPECT_EQ(fl_value_get_float_list(value)[2], M_PI);
394 }
fl_value_get_float_list
G_MODULE_EXPORT const double * fl_value_get_float_list(FlValue *self)
Definition: fl_value.cc:717
fl_value_new_float_list
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:339
fl_value_get_length
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:724
FL_VALUE_TYPE_FLOAT_LIST
@ FL_VALUE_TYPE_FLOAT_LIST
Definition: fl_value.h:72

References fl_value_get_float_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_float_list(), FL_VALUE_TYPE_FLOAT_LIST, and value.

## ◆ TEST() [17/107]

TEST | ( | FlValueTest | ,
|  | FloatListEmptyEqual |
| ) |  |

Definition at line 410 of file fl_value_test.cc.

410 {
411 g_autoptr(FlValue) value1 = fl_value_new_float_list(nullptr, 0);
412 g_autoptr(FlValue) value2 = fl_value_new_float_list(nullptr, 0);
413 EXPECT_TRUE(fl_value_equal(value1, value2));
414 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [18/107]

TEST | ( | FlValueTest | ,
|  | FloatListEmptyNotEqual |
| ) |  |

Definition at line 432 of file fl_value_test.cc.

432 {
433 g_autoptr(FlValue) value1 = fl_value_new_float_list(nullptr, 0);
434 double data[] = {0, -0.5, M_PI};
435 g_autoptr(FlValue) value2 = fl_value_new_float_list(data, 3);
436 EXPECT_FALSE(fl_value_equal(value1, value2));
437 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [19/107]

TEST | ( | FlValueTest | ,
|  | FloatListEqual |
| ) |  |

Definition at line 402 of file fl_value_test.cc.

402 {
403 double data1[] = {0, -0.5, M_PI};
404 g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
405 double data2[] = {0, -0.5, M_PI};
406 g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 3);
407 EXPECT_TRUE(fl_value_equal(value1, value2));
408 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [20/107]

TEST | ( | FlValueTest | ,
|  | FloatListNotEqualDifferentSize |
| ) |  |

Definition at line 424 of file fl_value_test.cc.

424 {
425 double data1[] = {0, -0.5, M_PI};
426 g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
427 double data2[] = {0, -0.5, M_PI, 42};
428 g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 4);
429 EXPECT_FALSE(fl_value_equal(value1, value2));
430 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [21/107]

TEST | ( | FlValueTest | ,
|  | FloatListNotEqualSameSize |
| ) |  |

Definition at line 416 of file fl_value_test.cc.

416 {
417 double data1[] = {0, -0.5, M_PI};
418 g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
419 double data2[] = {0, -0.5, M_E};
420 g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 3);
421 EXPECT_FALSE(fl_value_equal(value1, value2));
422 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [22/107]

TEST | ( | FlValueTest | ,
|  | FloatListNullptr |
| ) |  |

Definition at line 396 of file fl_value_test.cc.

396 {
397 g_autoptr(FlValue) value = fl_value_new_float_list(nullptr, 0);
398 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT_LIST);
399 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
400 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_float_list(), FL_VALUE_TYPE_FLOAT_LIST, and value.

## ◆ TEST() [23/107]

TEST | ( | FlValueTest | ,
|  | FloatListToString |
| ) |  |

Definition at line 439 of file fl_value_test.cc.

439 {
440 double data[] = {0, -0.5, M_PI};
441 g_autoptr(FlValue) value = fl_value_new_float_list(data, 3);
442 g_autofree gchar* text = fl_value_to_string(value);
443 EXPECT_STREQ(text, "[0.0, -0.5, 3.1415926535897931]");
444 }

References fl_value_new_float_list(), fl_value_to_string(), and value.

## ◆ TEST() [24/107]

TEST | ( | FlValueTest | ,
|  | FloatMinusOne |
| ) |  |

Definition at line 125 of file fl_value_test.cc.

125 {
126 g_autoptr(FlValue) value = fl_value_new_float(-1.0);
127 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
128 EXPECT_EQ(fl_value_get_float(value), -1.0);
129 }
fl_value_get_float
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:675
FL_VALUE_TYPE_FLOAT
@ FL_VALUE_TYPE_FLOAT
Definition: fl_value.h:67

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

## ◆ TEST() [25/107]

TEST | ( | FlValueTest | ,
|  | FloatNotEqual |
| ) |  |

Definition at line 143 of file fl_value_test.cc.

143 {
144 g_autoptr(FlValue) value1 = fl_value_new_float(M_PI);
145 g_autoptr(FlValue) value2 = fl_value_new_float(M_E);
146 EXPECT_FALSE(fl_value_equal(value1, value2));
147 }

References fl_value_equal(), and fl_value_new_float().

## ◆ TEST() [26/107]

TEST | ( | FlValueTest | ,
|  | FloatOne |
| ) |  |

Definition at line 119 of file fl_value_test.cc.

119 {
120 g_autoptr(FlValue) value = fl_value_new_float(1.0);
121 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
122 EXPECT_EQ(fl_value_get_float(value), 1.0);
123 }

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

## ◆ TEST() [27/107]

TEST | ( | FlValueTest | ,
|  | FloatPi |
| ) |  |

Definition at line 131 of file fl_value_test.cc.

131 {
132 g_autoptr(FlValue) value = fl_value_new_float(M_PI);
133 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
134 EXPECT_EQ(fl_value_get_float(value), M_PI);
135 }

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

## ◆ TEST() [28/107]

TEST | ( | FlValueTest | ,
|  | FloatToString |
| ) |  |

Definition at line 149 of file fl_value_test.cc.

149 {
150 g_autoptr(FlValue) value = fl_value_new_float(M_PI);
151 g_autofree gchar* text = fl_value_to_string(value);
152 EXPECT_STREQ(text, "3.1415926535897931");
153 }

References fl_value_new_float(), fl_value_to_string(), and value.

## ◆ TEST() [29/107]

TEST | ( | FlValueTest | ,
|  | FloatZero |
| ) |  |

Definition at line 113 of file fl_value_test.cc.

113 {
114 g_autoptr(FlValue) value = fl_value_new_float(0.0);
115 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
116 EXPECT_EQ(fl_value_get_float(value), 0.0);
117 }

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

## ◆ TEST() [30/107]

TEST | ( | FlValueTest | ,
|  | Int32List |
| ) |  |

Definition at line 264 of file fl_value_test.cc.

264 {
265 int32_t data[] = {0, -1, G_MAXINT32, G_MININT32};
266 g_autoptr(FlValue) value = fl_value_new_int32_list(data, 4);
267 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT32_LIST);
268 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
269 EXPECT_EQ(fl_value_get_int32_list(value)[0], 0);
270 EXPECT_EQ(fl_value_get_int32_list(value)[1], -1);
271 EXPECT_EQ(fl_value_get_int32_list(value)[2], G_MAXINT32);
272 EXPECT_EQ(fl_value_get_int32_list(value)[3], G_MININT32);
273 }
fl_value_new_int32_list
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:309
fl_value_get_int32_list
G_MODULE_EXPORT const int32_t * fl_value_get_int32_list(FlValue *self)
Definition: fl_value.cc:696
FL_VALUE_TYPE_INT32_LIST
@ FL_VALUE_TYPE_INT32_LIST
Definition: fl_value.h:70

References fl_value_get_int32_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_int32_list(), FL_VALUE_TYPE_INT32_LIST, and value.

## ◆ TEST() [31/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEmptyEqual |
| ) |  |

Definition at line 289 of file fl_value_test.cc.

289 {
290 g_autoptr(FlValue) value1 = fl_value_new_int32_list(nullptr, 0);
291 g_autoptr(FlValue) value2 = fl_value_new_int32_list(nullptr, 0);
292 EXPECT_TRUE(fl_value_equal(value1, value2));
293 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [32/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEmptyNotEqual |
| ) |  |

Definition at line 311 of file fl_value_test.cc.

311 {
312 g_autoptr(FlValue) value1 = fl_value_new_int32_list(nullptr, 0);
313 int32_t data[] = {0, G_MAXINT32, G_MININT32};
314 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data, 3);
315 EXPECT_FALSE(fl_value_equal(value1, value2));
316 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [33/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEqual |
| ) |  |

Definition at line 281 of file fl_value_test.cc.

281 {
282 int32_t data1[] = {0, G_MAXINT32, G_MININT32};
283 g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
284 int32_t data2[] = {0, G_MAXINT32, G_MININT32};
285 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 3);
286 EXPECT_TRUE(fl_value_equal(value1, value2));
287 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [34/107]

TEST | ( | FlValueTest | ,
|  | Int32ListInt64ListNotEqual |
| ) |  |

Definition at line 966 of file fl_value_test.cc.

966 {
967 int32_t data32[] = {0, 1, 2, 3, 4};
968 int64_t data64[] = {0, 1, 2, 3, 4};
969 g_autoptr(FlValue) value1 = fl_value_new_int32_list(data32, 5);
970 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data64, 5);
971 EXPECT_FALSE(fl_value_equal(value1, value2));
972 }
fl_value_new_int64_list
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:319

References fl_value_equal(), fl_value_new_int32_list(), and fl_value_new_int64_list().

## ◆ TEST() [35/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNotEqualDifferentSize |
| ) |  |

Definition at line 303 of file fl_value_test.cc.

303 {
304 int32_t data1[] = {0, G_MAXINT32, G_MININT32};
305 g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
306 int32_t data2[] = {0, G_MAXINT32, G_MININT32, -1};
307 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 4);
308 EXPECT_FALSE(fl_value_equal(value1, value2));
309 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [36/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNotEqualSameSize |
| ) |  |

Definition at line 295 of file fl_value_test.cc.

295 {
296 int32_t data1[] = {0, G_MAXINT32, G_MININT32};
297 g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
298 int32_t data2[] = {0, G_MININT32, G_MAXINT32};
299 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 3);
300 EXPECT_FALSE(fl_value_equal(value1, value2));
301 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [37/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNullptr |
| ) |  |

Definition at line 275 of file fl_value_test.cc.

275 {
276 g_autoptr(FlValue) value = fl_value_new_int32_list(nullptr, 0);
277 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT32_LIST);
278 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
279 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_int32_list(), FL_VALUE_TYPE_INT32_LIST, and value.

## ◆ TEST() [38/107]

TEST | ( | FlValueTest | ,
|  | Int32ListToString |
| ) |  |

Definition at line 318 of file fl_value_test.cc.

318 {
319 int32_t data[] = {0, G_MAXINT32, G_MININT32};
320 g_autoptr(FlValue) value = fl_value_new_int32_list(data, 3);
321 g_autofree gchar* text = fl_value_to_string(value);
322 EXPECT_STREQ(text, "[0, 2147483647, -2147483648]");
323 }

References fl_value_new_int32_list(), fl_value_to_string(), and value.

## ◆ TEST() [39/107]

TEST | ( | FlValueTest | ,
|  | Int64List |
| ) |  |

Definition at line 325 of file fl_value_test.cc.

325 {
326 int64_t data[] = {0, -1, G_MAXINT64, G_MININT64};
327 g_autoptr(FlValue) value = fl_value_new_int64_list(data, 4);
328 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT64_LIST);
329 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
330 EXPECT_EQ(fl_value_get_int64_list(value)[0], 0);
331 EXPECT_EQ(fl_value_get_int64_list(value)[1], -1);
332 EXPECT_EQ(fl_value_get_int64_list(value)[2], G_MAXINT64);
333 EXPECT_EQ(fl_value_get_int64_list(value)[3], G_MININT64);
334 }
fl_value_get_int64_list
G_MODULE_EXPORT const int64_t * fl_value_get_int64_list(FlValue *self)
Definition: fl_value.cc:703
FL_VALUE_TYPE_INT64_LIST
@ FL_VALUE_TYPE_INT64_LIST
Definition: fl_value.h:71

References fl_value_get_int64_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_int64_list(), FL_VALUE_TYPE_INT64_LIST, and value.

## ◆ TEST() [40/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEmptyEqual |
| ) |  |

Definition at line 350 of file fl_value_test.cc.

350 {
351 g_autoptr(FlValue) value1 = fl_value_new_int64_list(nullptr, 0);
352 g_autoptr(FlValue) value2 = fl_value_new_int64_list(nullptr, 0);
353 EXPECT_TRUE(fl_value_equal(value1, value2));
354 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [41/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEmptyNotEqual |
| ) |  |

Definition at line 372 of file fl_value_test.cc.

372 {
373 g_autoptr(FlValue) value1 = fl_value_new_int64_list(nullptr, 0);
374 int64_t data[] = {0, G_MAXINT64, G_MININT64};
375 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data, 3);
376 EXPECT_FALSE(fl_value_equal(value1, value2));
377 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [42/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEqual |
| ) |  |

Definition at line 342 of file fl_value_test.cc.

342 {
343 int64_t data1[] = {0, G_MAXINT64, G_MININT64};
344 g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
345 int64_t data2[] = {0, G_MAXINT64, G_MININT64};
346 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 3);
347 EXPECT_TRUE(fl_value_equal(value1, value2));
348 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [43/107]

TEST | ( | FlValueTest | ,
|  | Int64ListFloatListNotEqual |
| ) |  |

Definition at line 974 of file fl_value_test.cc.

974 {
975 int64_t data64[] = {0, 1, 2, 3, 4};
976 double dataf[] = {0.0, 1.0, 2.0, 3.0, 4.0};
977 g_autoptr(FlValue) value1 = fl_value_new_int64_list(data64, 5);
978 g_autoptr(FlValue) value2 = fl_value_new_float_list(dataf, 5);
979 EXPECT_FALSE(fl_value_equal(value1, value2));
980 }

References fl_value_equal(), fl_value_new_float_list(), and fl_value_new_int64_list().

## ◆ TEST() [44/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNotEqualDifferentSize |
| ) |  |

Definition at line 364 of file fl_value_test.cc.

364 {
365 int64_t data1[] = {0, G_MAXINT64, G_MININT64};
366 g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
367 int64_t data2[] = {0, G_MAXINT64, G_MININT64, -1};
368 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 4);
369 EXPECT_FALSE(fl_value_equal(value1, value2));
370 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [45/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNotEqualSameSize |
| ) |  |

Definition at line 356 of file fl_value_test.cc.

356 {
357 int64_t data1[] = {0, G_MAXINT64, G_MININT64};
358 g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
359 int64_t data2[] = {0, G_MININT64, G_MAXINT64};
360 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 3);
361 EXPECT_FALSE(fl_value_equal(value1, value2));
362 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [46/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNullptr |
| ) |  |

Definition at line 336 of file fl_value_test.cc.

336 {
337 g_autoptr(FlValue) value = fl_value_new_int64_list(nullptr, 0);
338 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT64_LIST);
339 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
340 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_int64_list(), FL_VALUE_TYPE_INT64_LIST, and value.

## ◆ TEST() [47/107]

TEST | ( | FlValueTest | ,
|  | Int64ListToString |
| ) |  |

Definition at line 379 of file fl_value_test.cc.

379 {
380 int64_t data[] = {0, G_MAXINT64, G_MININT64};
381 g_autoptr(FlValue) value = fl_value_new_int64_list(data, 3);
382 g_autofree gchar* text = fl_value_to_string(value);
383 EXPECT_STREQ(text, "[0, 9223372036854775807, -9223372036854775808]");
384 }

References fl_value_new_int64_list(), fl_value_to_string(), and value.

## ◆ TEST() [48/107]

TEST | ( | FlValueTest | ,
|  | IntEqual |
| ) |  |

Definition at line 95 of file fl_value_test.cc.

95 {
96 g_autoptr(FlValue) value1 = fl_value_new_int(42);
97 g_autoptr(FlValue) value2 = fl_value_new_int(42);
98 EXPECT_TRUE(fl_value_equal(value1, value2));
99 }
fl_value_new_int
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:262

References fl_value_equal(), and fl_value_new_int().

## ◆ TEST() [49/107]

TEST | ( | FlValueTest | ,
|  | IntMax |
| ) |  |

Definition at line 89 of file fl_value_test.cc.

89 {
90 g_autoptr(FlValue) value = fl_value_new_int(G_MAXINT64);
91 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
92 EXPECT_EQ(fl_value_get_int(value), G_MAXINT64);
93 }
fl_value_get_int
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:668
FL_VALUE_TYPE_INT
@ FL_VALUE_TYPE_INT
Definition: fl_value.h:66

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [50/107]

TEST | ( | FlValueTest | ,
|  | IntMin |
| ) |  |

Definition at line 83 of file fl_value_test.cc.

83 {
84 g_autoptr(FlValue) value = fl_value_new_int(G_MININT64);
85 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
86 EXPECT_EQ(fl_value_get_int(value), G_MININT64);
87 }

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [51/107]

TEST | ( | FlValueTest | ,
|  | IntMinusOne |
| ) |  |

Definition at line 77 of file fl_value_test.cc.

77 {
78 g_autoptr(FlValue) value = fl_value_new_int(-1);
79 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
80 EXPECT_EQ(fl_value_get_int(value), -1);
81 }

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [52/107]

TEST | ( | FlValueTest | ,
|  | IntNotEqual |
| ) |  |

Definition at line 101 of file fl_value_test.cc.

101 {
102 g_autoptr(FlValue) value1 = fl_value_new_int(42);
103 g_autoptr(FlValue) value2 = fl_value_new_int(99);
104 EXPECT_FALSE(fl_value_equal(value1, value2));
105 }

References fl_value_equal(), and fl_value_new_int().

## ◆ TEST() [53/107]

TEST | ( | FlValueTest | ,
|  | IntOne |
| ) |  |

Definition at line 71 of file fl_value_test.cc.

71 {
72 g_autoptr(FlValue) value = fl_value_new_int(1);
73 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
74 EXPECT_EQ(fl_value_get_int(value), 1);
75 }

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [54/107]

TEST | ( | FlValueTest | ,
|  | IntToString |
| ) |  |

Definition at line 107 of file fl_value_test.cc.

107 {
108 g_autoptr(FlValue) value = fl_value_new_int(42);
109 g_autofree gchar* text = fl_value_to_string(value);
110 EXPECT_STREQ(text, "42");
111 }

References fl_value_new_int(), fl_value_to_string(), and value.

## ◆ TEST() [55/107]

TEST | ( | FlValueTest | ,
|  | IntZero |
| ) |  |

Definition at line 65 of file fl_value_test.cc.

65 {
66 g_autoptr(FlValue) value = fl_value_new_int(0);
67 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
68 EXPECT_EQ(fl_value_get_int(value), 0);
69 }

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [56/107]

TEST | ( | FlValueTest | ,
|  | ListAdd |
| ) |  |

Definition at line 452 of file fl_value_test.cc.

452 {
453 g_autoptr(FlValue) value = fl_value_new_list();
454 g_autoptr(FlValue) child = fl_value_new_null();
455 fl_value_append(value, child);
456 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
457 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
458 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
459 FL_VALUE_TYPE_NULL);
460 }
fl_value_get_list_value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:776
fl_value_append
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:592
fl_value_new_list
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:349
FL_VALUE_TYPE_LIST
@ FL_VALUE_TYPE_LIST
Definition: fl_value.h:73

References fl_value_append(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_list(), fl_value_new_null(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_NULL, and value.

## ◆ TEST() [57/107]

TEST | ( | FlValueTest | ,
|  | ListAddTake |
| ) |  |

Definition at line 462 of file fl_value_test.cc.

462 {
463 g_autoptr(FlValue) value = fl_value_new_list();
464 fl_value_append_take(value, fl_value_new_null());
465 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
466 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
467 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
468 FL_VALUE_TYPE_NULL);
469 }
fl_value_append_take
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:600

References fl_value_append_take(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_list(), fl_value_new_null(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_NULL, and value.

## ◆ TEST() [58/107]

TEST | ( | FlValueTest | ,
|  | ListChildTypes |
| ) |  |

Definition at line 471 of file fl_value_test.cc.

471 {
472 g_autoptr(FlValue) value = fl_value_new_list();
473 fl_value_append_take(value, fl_value_new_null());
474 fl_value_append_take(value, fl_value_new_bool(TRUE));
475 fl_value_append_take(value, fl_value_new_int(42));
476 fl_value_append_take(value, fl_value_new_float(M_PI));
477 fl_value_append_take(value, fl_value_new_uint8_list(nullptr, 0));
478 fl_value_append_take(value, fl_value_new_int32_list(nullptr, 0));
479 fl_value_append_take(value, fl_value_new_int64_list(nullptr, 0));
480 fl_value_append_take(value, fl_value_new_float_list(nullptr, 0));
481 fl_value_append_take(value, fl_value_new_list());
482 fl_value_append_take(value, fl_value_new_map());
483 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
484 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
485 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
486 FL_VALUE_TYPE_NULL);
487 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 1)),
488 FL_VALUE_TYPE_BOOL);
489 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 2)),
490 FL_VALUE_TYPE_INT);
491 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 3)),
492 FL_VALUE_TYPE_FLOAT);
493 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 4)),
494 FL_VALUE_TYPE_UINT8_LIST);
495 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 5)),
496 FL_VALUE_TYPE_INT32_LIST);
497 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 6)),
498 FL_VALUE_TYPE_INT64_LIST);
499 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 7)),
500 FL_VALUE_TYPE_FLOAT_LIST);
501 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 8)),
502 FL_VALUE_TYPE_LIST);
503 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 9)),
504 FL_VALUE_TYPE_MAP);
505 }
fl_value_new_map
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
fl_value_new_uint8_list
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:292
FL_VALUE_TYPE_UINT8_LIST
@ FL_VALUE_TYPE_UINT8_LIST
Definition: fl_value.h:69
FL_VALUE_TYPE_MAP
@ FL_VALUE_TYPE_MAP
Definition: fl_value.h:74

References fl_value_append_take(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_uint8_list(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

## ◆ TEST() [59/107]

TEST | ( | FlValueTest | ,
|  | ListEmpty |
| ) |  |

Definition at line 446 of file fl_value_test.cc.

446 {
447 g_autoptr(FlValue) value = fl_value_new_list();
448 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
449 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
450 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_list(), FL_VALUE_TYPE_LIST, and value.

## ◆ TEST() [60/107]

TEST | ( | FlValueTest | ,
|  | ListEmptyEqual |
| ) |  |

Definition at line 539 of file fl_value_test.cc.

539 {
540 g_autoptr(FlValue) value1 = fl_value_new_list();
541 g_autoptr(FlValue) value2 = fl_value_new_list();
542 EXPECT_TRUE(fl_value_equal(value1, value2));
543 }

References fl_value_equal(), and fl_value_new_list().

## ◆ TEST() [61/107]

TEST | ( | FlValueTest | ,
|  | ListEmptyNotEqual |
| ) |  |

Definition at line 570 of file fl_value_test.cc.

570 {
571 g_autoptr(FlValue) value1 = fl_value_new_list();
572 g_autoptr(FlValue) value2 = fl_value_new_list();
573 fl_value_append_take(value2, fl_value_new_int(1));
574 fl_value_append_take(value2, fl_value_new_int(2));
575 fl_value_append_take(value2, fl_value_new_int(3));
576 EXPECT_FALSE(fl_value_equal(value1, value2));
577 }

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

## ◆ TEST() [62/107]

TEST | ( | FlValueTest | ,
|  | ListEqual |
| ) |  |

Definition at line 527 of file fl_value_test.cc.

527 {
528 g_autoptr(FlValue) value1 = fl_value_new_list();
529 fl_value_append_take(value1, fl_value_new_int(1));
530 fl_value_append_take(value1, fl_value_new_int(2));
531 fl_value_append_take(value1, fl_value_new_int(3));
532 g_autoptr(FlValue) value2 = fl_value_new_list();
533 fl_value_append_take(value2, fl_value_new_int(1));
534 fl_value_append_take(value2, fl_value_new_int(2));
535 fl_value_append_take(value2, fl_value_new_int(3));
536 EXPECT_TRUE(fl_value_equal(value1, value2));
537 }

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

## ◆ TEST() [63/107]

TEST | ( | FlValueTest | ,
|  | ListMapNotEqual |
| ) |  |

Definition at line 982 of file fl_value_test.cc.

982 {
983 g_autoptr(FlValue) value1 = fl_value_new_list();
984 g_autoptr(FlValue) value2 = fl_value_new_map();
985 EXPECT_FALSE(fl_value_equal(value1, value2));
986 }

References fl_value_equal(), fl_value_new_list(), and fl_value_new_map().

## ◆ TEST() [64/107]

TEST | ( | FlValueTest | ,
|  | ListNotEqualDifferentSize |
| ) |  |

Definition at line 557 of file fl_value_test.cc.

557 {
558 g_autoptr(FlValue) value1 = fl_value_new_list();
559 fl_value_append_take(value1, fl_value_new_int(1));
560 fl_value_append_take(value1, fl_value_new_int(2));
561 fl_value_append_take(value1, fl_value_new_int(3));
562 g_autoptr(FlValue) value2 = fl_value_new_list();
563 fl_value_append_take(value2, fl_value_new_int(1));
564 fl_value_append_take(value2, fl_value_new_int(2));
565 fl_value_append_take(value2, fl_value_new_int(3));
566 fl_value_append_take(value2, fl_value_new_int(4));
567 EXPECT_FALSE(fl_value_equal(value1, value2));
568 }

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

## ◆ TEST() [65/107]

TEST | ( | FlValueTest | ,
|  | ListNotEqualSameSize |
| ) |  |

Definition at line 545 of file fl_value_test.cc.

545 {
546 g_autoptr(FlValue) value1 = fl_value_new_list();
547 fl_value_append_take(value1, fl_value_new_int(1));
548 fl_value_append_take(value1, fl_value_new_int(2));
549 fl_value_append_take(value1, fl_value_new_int(3));
550 g_autoptr(FlValue) value2 = fl_value_new_list();
551 fl_value_append_take(value2, fl_value_new_int(1));
552 fl_value_append_take(value2, fl_value_new_int(2));
553 fl_value_append_take(value2, fl_value_new_int(4));
554 EXPECT_FALSE(fl_value_equal(value1, value2));
555 }

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

## ◆ TEST() [66/107]

TEST | ( | FlValueTest | ,
|  | ListStrv |
| ) |  |

Definition at line 507 of file fl_value_test.cc.

507 {
508 g_auto(GStrv) words = g_strsplit("hello:world", ":", -1);
509 g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
510 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
511 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(2));
512 ASSERT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
513 FL_VALUE_TYPE_STRING);
514 EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 0)), "hello");
515 ASSERT_EQ(fl_value_get_type(fl_value_get_list_value(value, 1)),
516 FL_VALUE_TYPE_STRING);
517 EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 1)), "world");
518 }
fl_value_get_string
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
fl_value_new_list_from_strv
G_MODULE_EXPORT FlValue * fl_value_new_list_from_strv(const gchar *const *str_array)
Definition: fl_value.cc:356
FL_VALUE_TYPE_STRING
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:68

References fl_value_get_length(), fl_value_get_list_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_list_from_strv(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [67/107]

TEST | ( | FlValueTest | ,
|  | ListStrvEmpty |
| ) |  |

Definition at line 520 of file fl_value_test.cc.

520 {
521 g_auto(GStrv) words = g_strsplit("", ":", -1);
522 g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
523 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
524 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
525 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_list_from_strv(), FL_VALUE_TYPE_LIST, and value.

## ◆ TEST() [68/107]

TEST | ( | FlValueTest | ,
|  | ListToString |
| ) |  |

Definition at line 579 of file fl_value_test.cc.

579 {
580 g_autoptr(FlValue) value = fl_value_new_list();
581 fl_value_append_take(value, fl_value_new_null());
582 fl_value_append_take(value, fl_value_new_bool(TRUE));
583 fl_value_append_take(value, fl_value_new_int(42));
584 fl_value_append_take(value, fl_value_new_float(M_PI));
585 fl_value_append_take(value, fl_value_new_uint8_list(nullptr, 0));
586 fl_value_append_take(value, fl_value_new_int32_list(nullptr, 0));
587 fl_value_append_take(value, fl_value_new_int64_list(nullptr, 0));
588 fl_value_append_take(value, fl_value_new_float_list(nullptr, 0));
589 fl_value_append_take(value, fl_value_new_list());
590 fl_value_append_take(value, fl_value_new_map());
591 g_autofree gchar* text = fl_value_to_string(value);
592 EXPECT_STREQ(text,
593 "[null, true, 42, 3.1415926535897931, [], [], [], [], [], {}]");
594 }

References fl_value_append_take(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_uint8_list(), fl_value_to_string(), TRUE, and value.

## ◆ TEST() [69/107]

TEST | ( | FlValueTest | ,
|  | MapEmpty |
| ) |  |

Definition at line 596 of file fl_value_test.cc.

596 {
597 g_autoptr(FlValue) value = fl_value_new_map();
598 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
599 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
600 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_map(), FL_VALUE_TYPE_MAP, and value.

## ◆ TEST() [70/107]

TEST | ( | FlValueTest | ,
|  | MapEmptyEqual |
| ) |  |

Definition at line 794 of file fl_value_test.cc.

794 {
795 g_autoptr(FlValue) value1 = fl_value_new_map();
796 g_autoptr(FlValue) value2 = fl_value_new_map();
797 EXPECT_TRUE(fl_value_equal(value1, value2));
798 }

References fl_value_equal(), and fl_value_new_map().

## ◆ TEST() [71/107]

TEST | ( | FlValueTest | ,
|  | MapEmptyNotEqual |
| ) |  |

Definition at line 837 of file fl_value_test.cc.

837 {
838 g_autoptr(FlValue) value1 = fl_value_new_map();
839 g_autoptr(FlValue) value2 = fl_value_new_map();
840 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
841 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
842 fl_value_set_string_take(value2, "three", fl_value_new_int(3));
843 EXPECT_FALSE(fl_value_equal(value1, value2));
844 }
fl_value_set_string_take
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [72/107]

TEST | ( | FlValueTest | ,
|  | MapEqual |
| ) |  |

Definition at line 770 of file fl_value_test.cc.

770 {
771 g_autoptr(FlValue) value1 = fl_value_new_map();
772 fl_value_set_string_take(value1, "one", fl_value_new_int(1));
773 fl_value_set_string_take(value1, "two", fl_value_new_int(2));
774 fl_value_set_string_take(value1, "three", fl_value_new_int(3));
775 g_autoptr(FlValue) value2 = fl_value_new_map();
776 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
777 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
778 fl_value_set_string_take(value2, "three", fl_value_new_int(3));
779 EXPECT_TRUE(fl_value_equal(value1, value2));
780 }

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [73/107]

TEST | ( | FlValueTest | ,
|  | MapEqualDifferentOrder |
| ) |  |

Definition at line 782 of file fl_value_test.cc.

782 {
783 g_autoptr(FlValue) value1 = fl_value_new_map();
784 fl_value_set_string_take(value1, "one", fl_value_new_int(1));
785 fl_value_set_string_take(value1, "two", fl_value_new_int(2));
786 fl_value_set_string_take(value1, "three", fl_value_new_int(3));
787 g_autoptr(FlValue) value2 = fl_value_new_map();
788 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
789 fl_value_set_string_take(value2, "three", fl_value_new_int(3));
790 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
791 EXPECT_TRUE(fl_value_equal(value1, value2));
792 }

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [74/107]

TEST | ( | FlValueTest | ,
|  | MapKeyTypes |
| ) |  |

Definition at line 728 of file fl_value_test.cc.

728 {
729 g_autoptr(FlValue) value = fl_value_new_map();
730 fl_value_set_take(value, fl_value_new_null(), fl_value_new_string("null"));
731 fl_value_set_take(value, fl_value_new_bool(TRUE),
732 fl_value_new_string("bool"));
733 fl_value_set_take(value, fl_value_new_int(42), fl_value_new_string("int"));
734 fl_value_set_take(value, fl_value_new_float(M_PI),
735 fl_value_new_string("float"));
736 fl_value_set_take(value, fl_value_new_uint8_list(nullptr, 0),
737 fl_value_new_string("uint8_list"));
738 fl_value_set_take(value, fl_value_new_int32_list(nullptr, 0),
739 fl_value_new_string("int32_list"));
740 fl_value_set_take(value, fl_value_new_int64_list(nullptr, 0),
741 fl_value_new_string("int64_list"));
742 fl_value_set_take(value, fl_value_new_float_list(nullptr, 0),
743 fl_value_new_string("float_list"));
744 fl_value_set_take(value, fl_value_new_list(), fl_value_new_string("list"));
745 fl_value_set_take(value, fl_value_new_map(), fl_value_new_string("map"));
746 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
747 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
748 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
749 FL_VALUE_TYPE_NULL);
750 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 1)),
751 FL_VALUE_TYPE_BOOL);
752 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 2)),
753 FL_VALUE_TYPE_INT);
754 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 3)),
755 FL_VALUE_TYPE_FLOAT);
756 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 4)),
757 FL_VALUE_TYPE_UINT8_LIST);
758 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 5)),
759 FL_VALUE_TYPE_INT32_LIST);
760 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 6)),
761 FL_VALUE_TYPE_INT64_LIST);
762 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 7)),
763 FL_VALUE_TYPE_FLOAT_LIST);
764 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 8)),
765 FL_VALUE_TYPE_LIST);
766 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 9)),
767 FL_VALUE_TYPE_MAP);
768 }
fl_value_new_string
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
fl_value_set_take
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:618
fl_value_get_map_key
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:784

References fl_value_get_length(), fl_value_get_map_key(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

## ◆ TEST() [75/107]

TEST | ( | FlValueTest | ,
|  | MapLookup |
| ) |  |

Definition at line 657 of file fl_value_test.cc.

657 {
658 g_autoptr(FlValue) value = fl_value_new_map();
659 fl_value_set_string_take(value, "one", fl_value_new_int(1));
660 fl_value_set_string_take(value, "two", fl_value_new_int(2));
661 fl_value_set_string_take(value, "three", fl_value_new_int(3));
662 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
663 g_autoptr(FlValue) two_key = fl_value_new_string("two");
664 FlValue* v = fl_value_lookup(value, two_key);
665 ASSERT_NE(v, nullptr);
666 ASSERT_EQ(fl_value_get_type(v), FL_VALUE_TYPE_INT);
667 EXPECT_EQ(fl_value_get_int(v), 2);
668 g_autoptr(FlValue) four_key = fl_value_new_string("four");
669 v = fl_value_lookup(value, four_key);
670 ASSERT_EQ(v, nullptr);
671 }
fl_value_lookup
G_MODULE_EXPORT FlValue * fl_value_lookup(FlValue *self, FlValue *key)
Definition: fl_value.cc:800

References fl_value_get_int(), fl_value_get_type(), fl_value_lookup(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, and value.

## ◆ TEST() [76/107]

TEST | ( | FlValueTest | ,
|  | MapLookupString |
| ) |  |

Definition at line 673 of file fl_value_test.cc.

673 {
674 g_autoptr(FlValue) value = fl_value_new_map();
675 fl_value_set_string_take(value, "one", fl_value_new_int(1));
676 fl_value_set_string_take(value, "two", fl_value_new_int(2));
677 fl_value_set_string_take(value, "three", fl_value_new_int(3));
678 FlValue* v = fl_value_lookup_string(value, "two");
679 ASSERT_NE(v, nullptr);
680 ASSERT_EQ(fl_value_get_type(v), FL_VALUE_TYPE_INT);
681 EXPECT_EQ(fl_value_get_int(v), 2);
682 v = fl_value_lookup_string(value, "four");
683 ASSERT_EQ(v, nullptr);
684 }
fl_value_lookup_string
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:811

References fl_value_get_int(), fl_value_get_type(), fl_value_lookup_string(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, and value.

## ◆ TEST() [77/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualDifferentSize |
| ) |  |

Definition at line 824 of file fl_value_test.cc.

824 {
825 g_autoptr(FlValue) value1 = fl_value_new_map();
826 fl_value_set_string_take(value1, "one", fl_value_new_int(1));
827 fl_value_set_string_take(value1, "two", fl_value_new_int(2));
828 fl_value_set_string_take(value1, "three", fl_value_new_int(3));
829 g_autoptr(FlValue) value2 = fl_value_new_map();
830 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
831 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
832 fl_value_set_string_take(value2, "three", fl_value_new_int(3));
833 fl_value_set_string_take(value2, "four", fl_value_new_int(4));
834 EXPECT_FALSE(fl_value_equal(value1, value2));
835 }

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [78/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualSameSizeDifferentKeys |
| ) |  |

Definition at line 800 of file fl_value_test.cc.

800 {
801 g_autoptr(FlValue) value1 = fl_value_new_map();
802 fl_value_set_string_take(value1, "one", fl_value_new_int(1));
803 fl_value_set_string_take(value1, "two", fl_value_new_int(2));
804 fl_value_set_string_take(value1, "three", fl_value_new_int(3));
805 g_autoptr(FlValue) value2 = fl_value_new_map();
806 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
807 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
808 fl_value_set_string_take(value2, "four", fl_value_new_int(3));
809 EXPECT_FALSE(fl_value_equal(value1, value2));
810 }

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [79/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualSameSizeDifferentValues |
| ) |  |

Definition at line 812 of file fl_value_test.cc.

812 {
813 g_autoptr(FlValue) value1 = fl_value_new_map();
814 fl_value_set_string_take(value1, "one", fl_value_new_int(1));
815 fl_value_set_string_take(value1, "two", fl_value_new_int(2));
816 fl_value_set_string_take(value1, "three", fl_value_new_int(3));
817 g_autoptr(FlValue) value2 = fl_value_new_map();
818 fl_value_set_string_take(value2, "one", fl_value_new_int(1));
819 fl_value_set_string_take(value2, "two", fl_value_new_int(2));
820 fl_value_set_string_take(value2, "three", fl_value_new_int(4));
821 EXPECT_FALSE(fl_value_equal(value1, value2));
822 }

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

## ◆ TEST() [80/107]

TEST | ( | FlValueTest | ,
|  | MapSet |
| ) |  |

Definition at line 602 of file fl_value_test.cc.

602 {
603 g_autoptr(FlValue) value = fl_value_new_map();
604 g_autoptr(FlValue) k = fl_value_new_string("count");
605 g_autoptr(FlValue) v = fl_value_new_int(42);
606 fl_value_set(value, k, v);
607 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
608 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
609 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
610 FL_VALUE_TYPE_STRING);
611 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
612 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
613 FL_VALUE_TYPE_INT);
614 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
615 }
fl_value_get_map_value
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:792
fl_value_set
G_MODULE_EXPORT void fl_value_set(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:609

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [81/107]

TEST | ( | FlValueTest | ,
|  | MapSetString |
| ) |  |

Definition at line 630 of file fl_value_test.cc.

630 {
631 g_autoptr(FlValue) value = fl_value_new_map();
632 g_autoptr(FlValue) v = fl_value_new_int(42);
633 fl_value_set_string(value, "count", v);
634 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
635 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
636 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
637 FL_VALUE_TYPE_STRING);
638 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
639 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
640 FL_VALUE_TYPE_INT);
641 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
642 }
fl_value_set_string
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:639

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [82/107]

TEST | ( | FlValueTest | ,
|  | MapSetStringTake |
| ) |  |

Definition at line 644 of file fl_value_test.cc.

644 {
645 g_autoptr(FlValue) value = fl_value_new_map();
646 fl_value_set_string_take(value, "count", fl_value_new_int(42));
647 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
648 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
649 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
650 FL_VALUE_TYPE_STRING);
651 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
652 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
653 FL_VALUE_TYPE_INT);
654 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
655 }

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [83/107]

TEST | ( | FlValueTest | ,
|  | MapSetTake |
| ) |  |

Definition at line 617 of file fl_value_test.cc.

617 {
618 g_autoptr(FlValue) value = fl_value_new_map();
619 fl_value_set_take(value, fl_value_new_string("count"), fl_value_new_int(42));
620 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
621 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
622 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
623 FL_VALUE_TYPE_STRING);
624 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
625 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
626 FL_VALUE_TYPE_INT);
627 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
628 }

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [84/107]

TEST | ( | FlValueTest | ,
|  | MapToString |
| ) |  |

Definition at line 846 of file fl_value_test.cc.

846 {
847 g_autoptr(FlValue) value = fl_value_new_map();
848 fl_value_set_take(value, fl_value_new_string("null"), fl_value_new_null());
849 fl_value_set_take(value, fl_value_new_string("bool"),
850 fl_value_new_bool(TRUE));
851 fl_value_set_take(value, fl_value_new_string("int"), fl_value_new_int(42));
852 fl_value_set_take(value, fl_value_new_string("float"),
853 fl_value_new_float(M_PI));
854 fl_value_set_take(value, fl_value_new_string("uint8_list"),
855 fl_value_new_uint8_list(nullptr, 0));
856 fl_value_set_take(value, fl_value_new_string("int32_list"),
857 fl_value_new_int32_list(nullptr, 0));
858 fl_value_set_take(value, fl_value_new_string("int64_list"),
859 fl_value_new_int64_list(nullptr, 0));
860 fl_value_set_take(value, fl_value_new_string("float_list"),
861 fl_value_new_float_list(nullptr, 0));
862 fl_value_set_take(value, fl_value_new_string("list"), fl_value_new_list());
863 fl_value_set_take(value, fl_value_new_string("map"), fl_value_new_map());
864 fl_value_set_take(value, fl_value_new_null(), fl_value_new_string("null"));
865 fl_value_set_take(value, fl_value_new_bool(TRUE),
866 fl_value_new_string("bool"));
867 fl_value_set_take(value, fl_value_new_int(42), fl_value_new_string("int"));
868 fl_value_set_take(value, fl_value_new_float(M_PI),
869 fl_value_new_string("float"));
870 fl_value_set_take(value, fl_value_new_uint8_list(nullptr, 0),
871 fl_value_new_string("uint8_list"));
872 fl_value_set_take(value, fl_value_new_int32_list(nullptr, 0),
873 fl_value_new_string("int32_list"));
874 fl_value_set_take(value, fl_value_new_int64_list(nullptr, 0),
875 fl_value_new_string("int64_list"));
876 fl_value_set_take(value, fl_value_new_float_list(nullptr, 0),
877 fl_value_new_string("float_list"));
878 fl_value_set_take(value, fl_value_new_list(), fl_value_new_string("list"));
879 fl_value_set_take(value, fl_value_new_map(), fl_value_new_string("map"));
880 g_autofree gchar* text = fl_value_to_string(value);
881 EXPECT_STREQ(text,
882 "{null: null, bool: true, int: 42, float: 3.1415926535897931, "
883 "uint8_list: [], int32_list: [], int64_list: [], float_list: "
884 "[], list: [], map: {}, null: null, true: bool, 42: int, "
885 "3.1415926535897931: float, []: uint8_list, []: int32_list, []: "
886 "int64_list, []: float_list, []: list, {}: map}");
887 }

References fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), fl_value_to_string(), TRUE, and value.

## ◆ TEST() [85/107]

TEST | ( | FlValueTest | ,
|  | MapValueypes |
| ) |  |

Definition at line 686 of file fl_value_test.cc.

686 {
687 g_autoptr(FlValue) value = fl_value_new_map();
688 fl_value_set_take(value, fl_value_new_string("null"), fl_value_new_null());
689 fl_value_set_take(value, fl_value_new_string("bool"),
690 fl_value_new_bool(TRUE));
691 fl_value_set_take(value, fl_value_new_string("int"), fl_value_new_int(42));
692 fl_value_set_take(value, fl_value_new_string("float"),
693 fl_value_new_float(M_PI));
694 fl_value_set_take(value, fl_value_new_string("uint8_list"),
695 fl_value_new_uint8_list(nullptr, 0));
696 fl_value_set_take(value, fl_value_new_string("int32_list"),
697 fl_value_new_int32_list(nullptr, 0));
698 fl_value_set_take(value, fl_value_new_string("int64_list"),
699 fl_value_new_int64_list(nullptr, 0));
700 fl_value_set_take(value, fl_value_new_string("float_list"),
701 fl_value_new_float_list(nullptr, 0));
702 fl_value_set_take(value, fl_value_new_string("list"), fl_value_new_list());
703 fl_value_set_take(value, fl_value_new_string("map"), fl_value_new_map());
704 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
705 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
706 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
707 FL_VALUE_TYPE_NULL);
708 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 1)),
709 FL_VALUE_TYPE_BOOL);
710 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 2)),
711 FL_VALUE_TYPE_INT);
712 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 3)),
713 FL_VALUE_TYPE_FLOAT);
714 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 4)),
715 FL_VALUE_TYPE_UINT8_LIST);
716 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 5)),
717 FL_VALUE_TYPE_INT32_LIST);
718 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 6)),
719 FL_VALUE_TYPE_INT64_LIST);
720 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 7)),
721 FL_VALUE_TYPE_FLOAT_LIST);
722 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 8)),
723 FL_VALUE_TYPE_LIST);
724 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 9)),
725 FL_VALUE_TYPE_MAP);
726 }

References fl_value_get_length(), fl_value_get_map_value(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

## ◆ TEST() [86/107]

TEST | ( | FlValueTest | ,
|  | NullBoolNotEqual |
| ) |  |

Definition at line 945 of file fl_value_test.cc.

945 {
946 g_autoptr(FlValue) value1 = fl_value_new_bool(FALSE);
947 g_autoptr(FlValue) value2 = fl_value_new_int(0);
948 EXPECT_FALSE(fl_value_equal(value1, value2));
949 }

References fl_value_equal(), fl_value_new_bool(), and fl_value_new_int().

## ◆ TEST() [87/107]

TEST | ( | FlValueTest | ,
|  | NullEqual |
| ) |  |

Definition at line 17 of file fl_value_test.cc.

17 {
18 g_autoptr(FlValue) value1 = fl_value_new_null();
19 g_autoptr(FlValue) value2 = fl_value_new_null();
20 EXPECT_TRUE(fl_value_equal(value1, value2));
21 }

References fl_value_equal(), and fl_value_new_null().

## ◆ TEST() [88/107]

TEST | ( | FlValueTest | ,
|  | NullIntNotEqual |
| ) |  |

Definition at line 939 of file fl_value_test.cc.

939 {
940 g_autoptr(FlValue) value1 = fl_value_new_null();
941 g_autoptr(FlValue) value2 = fl_value_new_int(0);
942 EXPECT_FALSE(fl_value_equal(value1, value2));
943 }

References fl_value_equal(), fl_value_new_int(), and fl_value_new_null().

## ◆ TEST() [89/107]

TEST | ( | FlValueTest | ,
|  | NullToString |
| ) |  |

Definition at line 23 of file fl_value_test.cc.

23 {
24 g_autoptr(FlValue) value = fl_value_new_null();
25 g_autofree gchar* text = fl_value_to_string(value);
26 EXPECT_STREQ(text, "null");
27 }

References fl_value_new_null(), fl_value_to_string(), and value.

## ◆ TEST() [90/107]

TEST | ( | FlValueTest | ,
|  | String |
| ) |  |

Definition at line 155 of file fl_value_test.cc.

155 {
156 g_autoptr(FlValue) value = fl_value_new_string("hello");
157 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
158 EXPECT_STREQ(fl_value_get_string(value), "hello");
159 }

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [91/107]

TEST | ( | FlValueTest | ,
|  | StringEmpty |
| ) |  |

Definition at line 161 of file fl_value_test.cc.

161 {
162 g_autoptr(FlValue) value = fl_value_new_string("");
163 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
164 EXPECT_STREQ(fl_value_get_string(value), "");
165 }

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [92/107]

TEST | ( | FlValueTest | ,
|  | StringEqual |
| ) |  |

Definition at line 185 of file fl_value_test.cc.

185 {
186 g_autoptr(FlValue) value1 = fl_value_new_string("hello");
187 g_autoptr(FlValue) value2 = fl_value_new_string("hello");
188 EXPECT_TRUE(fl_value_equal(value1, value2));
189 }

References fl_value_equal(), and fl_value_new_string().

## ◆ TEST() [93/107]

TEST | ( | FlValueTest | ,
|  | StringNotEqual |
| ) |  |

Definition at line 191 of file fl_value_test.cc.

191 {
192 g_autoptr(FlValue) value1 = fl_value_new_string("hello");
193 g_autoptr(FlValue) value2 = fl_value_new_string("world");
194 EXPECT_FALSE(fl_value_equal(value1, value2));
195 }

References fl_value_equal(), and fl_value_new_string().

## ◆ TEST() [94/107]

TEST | ( | FlValueTest | ,
|  | StringSized |
| ) |  |

Definition at line 167 of file fl_value_test.cc.

167 {
168 g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 2);
169 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
170 EXPECT_STREQ(fl_value_get_string(value), "he");
171 }
fl_value_new_string_sized
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:283

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [95/107]

TEST | ( | FlValueTest | ,
|  | StringSizedNullptr |
| ) |  |

Definition at line 173 of file fl_value_test.cc.

173 {
174 g_autoptr(FlValue) value = fl_value_new_string_sized(nullptr, 0);
175 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
176 EXPECT_STREQ(fl_value_get_string(value), "");
177 }

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [96/107]

TEST | ( | FlValueTest | ,
|  | StringSizedZeroLength |
| ) |  |

Definition at line 179 of file fl_value_test.cc.

179 {
180 g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 0);
181 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
182 EXPECT_STREQ(fl_value_get_string(value), "");
183 }

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

## ◆ TEST() [97/107]

TEST | ( | FlValueTest | ,
|  | StringToString |
| ) |  |

Definition at line 197 of file fl_value_test.cc.

197 {
198 g_autoptr(FlValue) value = fl_value_new_string("hello");
199 g_autofree gchar* text = fl_value_to_string(value);
200 EXPECT_STREQ(text, "hello");
201 }

References fl_value_new_string(), fl_value_to_string(), and value.

## ◆ TEST() [98/107]

TEST | ( | FlValueTest | ,
|  | StringUint8ListNotEqual |
| ) |  |

Definition at line 951 of file fl_value_test.cc.

951 {
952 uint8_t data[] = {'h', 'e', 'l', 'l', 'o'};
953 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data, 5);
954 g_autoptr(FlValue) value2 = fl_value_new_string("hello");
955 EXPECT_FALSE(fl_value_equal(value1, value2));
956 }

References fl_value_equal(), fl_value_new_string(), and fl_value_new_uint8_list().

## ◆ TEST() [99/107]

TEST | ( | FlValueTest | ,
|  | Uint8List |
| ) |  |

Definition at line 203 of file fl_value_test.cc.

203 {
204 uint8_t data[] = {0x00, 0x01, 0xFE, 0xFF};
205 g_autoptr(FlValue) value = fl_value_new_uint8_list(data, 4);
206 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_UINT8_LIST);
207 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
208 EXPECT_EQ(fl_value_get_uint8_list(value)[0], 0x00);
209 EXPECT_EQ(fl_value_get_uint8_list(value)[1], 0x01);
210 EXPECT_EQ(fl_value_get_uint8_list(value)[2], 0xFE);
211 EXPECT_EQ(fl_value_get_uint8_list(value)[3], 0xFF);
212 }
fl_value_get_uint8_list
G_MODULE_EXPORT const uint8_t * fl_value_get_uint8_list(FlValue *self)
Definition: fl_value.cc:689

References fl_value_get_length(), fl_value_get_type(), fl_value_get_uint8_list(), fl_value_new_uint8_list(), FL_VALUE_TYPE_UINT8_LIST, and value.

## ◆ TEST() [100/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEmptyEqual |
| ) |  |

Definition at line 228 of file fl_value_test.cc.

228 {
229 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(nullptr, 0);
230 g_autoptr(FlValue) value2 = fl_value_new_uint8_list(nullptr, 0);
231 EXPECT_TRUE(fl_value_equal(value1, value2));
232 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [101/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEmptyNotEqual |
| ) |  |

Definition at line 250 of file fl_value_test.cc.

250 {
251 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(nullptr, 0);
252 uint8_t data[] = {1, 2, 3};
253 g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data, 3);
254 EXPECT_FALSE(fl_value_equal(value1, value2));
255 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [102/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEqual |
| ) |  |

Definition at line 220 of file fl_value_test.cc.

220 {
221 uint8_t data1[] = {1, 2, 3};
222 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
223 uint8_t data2[] = {1, 2, 3};
224 g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 3);
225 EXPECT_TRUE(fl_value_equal(value1, value2));
226 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [103/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListInt32ListNotEqual |
| ) |  |

Definition at line 958 of file fl_value_test.cc.

958 {
959 uint8_t data8[] = {0, 1, 2, 3, 4};
960 int32_t data32[] = {0, 1, 2, 3, 4};
961 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data8, 5);
962 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data32, 5);
963 EXPECT_FALSE(fl_value_equal(value1, value2));
964 }

References fl_value_equal(), fl_value_new_int32_list(), and fl_value_new_uint8_list().

## ◆ TEST() [104/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNotEqualDifferentSize |
| ) |  |

Definition at line 242 of file fl_value_test.cc.

242 {
243 uint8_t data1[] = {1, 2, 3};
244 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
245 uint8_t data2[] = {1, 2, 3, 4};
246 g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 4);
247 EXPECT_FALSE(fl_value_equal(value1, value2));
248 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [105/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNotEqualSameSize |
| ) |  |

Definition at line 234 of file fl_value_test.cc.

234 {
235 uint8_t data1[] = {1, 2, 3};
236 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
237 uint8_t data2[] = {1, 2, 4};
238 g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 3);
239 EXPECT_FALSE(fl_value_equal(value1, value2));
240 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [106/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNullptr |
| ) |  |

Definition at line 214 of file fl_value_test.cc.

214 {
215 g_autoptr(FlValue) value = fl_value_new_uint8_list(nullptr, 0);
216 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_UINT8_LIST);
217 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
218 }

References fl_value_get_length(), fl_value_get_type(), fl_value_new_uint8_list(), FL_VALUE_TYPE_UINT8_LIST, and value.

## ◆ TEST() [107/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListToString |
| ) |  |

Definition at line 257 of file fl_value_test.cc.

257 {
258 uint8_t data[] = {0x00, 0x01, 0xFE, 0xFF};
259 g_autoptr(FlValue) value = fl_value_new_uint8_list(data, 4);
260 g_autofree gchar* text = fl_value_to_string(value);
261 EXPECT_STREQ(text, "[0, 1, 254, 255]");
262 }

References fl_value_new_uint8_list(), fl_value_to_string(), and value.