+static void
+do_default_atoms(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
+{
+ int type;
+
+ for (type = 0; type < OVSDB_N_TYPES; type++) {
+ union ovsdb_atom atom;
+
+ if (type == OVSDB_TYPE_VOID) {
+ continue;
+ }
+
+ printf("%s: ", ovsdb_atomic_type_to_string(type));
+
+ ovsdb_atom_init_default(&atom, type);
+ if (!ovsdb_atom_equals(&atom, ovsdb_atom_default(type), type)) {
+ printf("wrong\n");
+ exit(1);
+ }
+ ovsdb_atom_destroy(&atom, type);
+
+ printf("OK\n");
+ }
+}
+
+static void
+do_default_data(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
+{
+ unsigned int n_min;
+ int key, value;
+
+ for (n_min = 0; n_min <= 1; n_min++) {
+ for (key = 0; key < OVSDB_N_TYPES; key++) {
+ if (key == OVSDB_TYPE_VOID) {
+ continue;
+ }
+ for (value = 0; value < OVSDB_N_TYPES; value++) {
+ struct ovsdb_datum datum;
+ struct ovsdb_type type;
+
+ ovsdb_base_type_init(&type.key, key);
+ ovsdb_base_type_init(&type.value, value);
+ type.n_min = n_min;
+ type.n_max = 1;
+ assert(ovsdb_type_is_valid(&type));
+
+ printf("key %s, value %s, n_min %u: ",
+ ovsdb_atomic_type_to_string(key),
+ ovsdb_atomic_type_to_string(value), n_min);
+
+ ovsdb_datum_init_default(&datum, &type);
+ if (!ovsdb_datum_equals(&datum, ovsdb_datum_default(&type),
+ &type)) {
+ printf("wrong\n");
+ exit(1);
+ }
+ ovsdb_datum_destroy(&datum, &type);
+ ovsdb_type_destroy(&type);
+
+ printf("OK\n");
+ }
+ }
+ }
+}
+