I have a schema like so:

struct Initialization {
  random @0 :Bool = true;
  radius @1 :Float64 = 1.0;
  file @2 :Text;
}

and a matching test file to make sure I understand behavior:

TEST(initilizationTests, MemoryInitialization) {

  const char * initialization_file = "initialize.cs";

  ::capnp::MallocMessageBuilder message;
  capnStan::Initialization::Builder init = 
message.initRoot<capnStan::Initialization>();
  init.setRandom(true);
  init.setRadius(3.3);
  init.setFile(initialization_file);

  EXPECT_EQ(init.getRandom(), true);
  EXPECT_DOUBLE_EQ(init.getRadius(), 3.3);
  EXPECT_EQ(init.getRadius(), 3.3);
  EXPECT_EQ(std::string(init.getFile().cStr()), 
std::string(initialization_file));
}

I was hoping to round-trip a double successfully through the 'radius' field 
and it works (in so far as the 
floating point equality and exact equality tests pass).  They likewise pass 
for a test that writes the message
to a file in between.  I was expecting/hoping that this would be the case 
on a single machine.

I'm not so sure about shipping the file between machines with different 
hardware and what to expect
there.  Does anybody have experience with that offhand?

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to