40 class test_entity :
public application_shell
43 test_entity() : application_shell(class_name()) {}
45 virtual int execute();
48 int test_entity::execute()
51 SET_DEFAULT_COMBO_LOGGER;
54 octopus_entity blankie;
57 "the blank entity was not seen as empty.");
58 octopus_entity fullish(
"gurp", 28, 39, 4);
61 "the non-blank entity was seen as empty.");
65 octopus_entity blank_ent;
66 int sequencer =
rando.inclusive(1, MAXINT - 10);
67 int add_in =
rando.inclusive(0, MAXINT - 10);
68 octopus_entity filled_ent(stack.hostname(), application_configuration::process_id(), sequencer,
70 blank_ent = octopus_entity(stack.hostname(), application_configuration::process_id(), sequencer,
72 if (blank_ent != filled_ent)
74 "failed to resolve to same id");
75 astring text1 = filled_ent.to_text();
76 astring text2 = blank_ent.to_text();
78 deadly_error(class_name(),
"to_text test",
"strings are different");
80 octopus_entity georgio = octopus_entity::from_text(text2);
82 if (georgio != filled_ent)
84 "entity is different after from_text");
86 octopus_request_id fudnix(filled_ent, 8232390);
87 astring text3 = fudnix.to_text();
88 octopus_request_id resur = octopus_request_id::from_text(text3);
91 "request id is different after from_text");
93 blank_ent = octopus_entity();
94 blank_ent = octopus_entity(filled_ent.hostname(), filled_ent.process_id(),
95 filled_ent.sequencer(), filled_ent.add_in());
96 if (blank_ent != filled_ent)
98 "failed to resolve to same id");
102 filled_ent.pack(chunk1);
103 octopus_entity unpacked1;
104 unpacked1.unpack(chunk1);
105 if (unpacked1 != filled_ent)
107 "failed to return same values");
110 octopus_entity ent(string_manipulation::make_random_name(1, 428),
114 octopus_request_id bobo(ent,
randomizer().inclusive(0, MAXINT/2));
115 int packed_estimate = bobo.packed_size();
116 byte_array packed_bobo;
117 bobo.pack(packed_bobo);
118 if (packed_bobo.length() != packed_estimate)
120 "calculated incorrect packed size");
124 log(
"octopus_entity:: works for those functions tested.");
#define deadly_error(c, f, i)
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
#define HOOPLE_MAIN(obj_name, obj_args)
options that should work for most unix and linux apps.
const int ITERATE_EACH_TEST