summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/codec-json/c++/json.tmpl.hpp2
-rw-r--r--modules/codec-json/tests/codec-json.cpp16
-rw-r--r--modules/codec-netcdf/tests/codec-netcdf.cpp2
-rw-r--r--modules/crypto/c++/hash.hpp6
-rw-r--r--modules/io_codec/examples/peer_echo_client.cpp2
-rw-r--r--modules/io_codec/examples/peer_echo_server.cpp2
-rw-r--r--modules/remote-filesystem/examples/remote_read_file.cpp2
-rw-r--r--modules/remote/tests/remote_loopback.cpp4
8 files changed, 18 insertions, 18 deletions
diff --git a/modules/codec-json/c++/json.tmpl.hpp b/modules/codec-json/c++/json.tmpl.hpp
index bead73a..1eb46bc 100644
--- a/modules/codec-json/c++/json.tmpl.hpp
+++ b/modules/codec-json/c++/json.tmpl.hpp
@@ -109,7 +109,7 @@ struct json_encode<schema::String, FromEncode> {
return err;
}
}
- for(std::size_t i = 0; i < from.size(); ++i){
+ for(std::size_t i = 0; i < from.size().get(); ++i){
auto err = to.push(from.get_at(i));
if(!err.template is_type<err::no_error>()){
return err;
diff --git a/modules/codec-json/tests/codec-json.cpp b/modules/codec-json/tests/codec-json.cpp
index 1d6c0f0..95b0d40 100644
--- a/modules/codec-json/tests/codec-json.cpp
+++ b/modules/codec-json/tests/codec-json.cpp
@@ -273,10 +273,10 @@ SAW_TEST("Three Dim Array write and read"){
data<schema::TestMultiArray, encode::Native> native{2,1,2};
data<schema::TestMultiArray, encode::Json> json;
- native.at(0,0,0).set("multi");
- native.at(0,0,1).set("baz");
- native.at(1,0,0).set("foo");
- native.at(1,0,1).set("bar");
+ native.at({0,0,0}).set("multi");
+ native.at({0,0,1}).set("baz");
+ native.at({1,0,0}).set("foo");
+ native.at({1,0,1}).set("bar");
codec<schema::TestMultiArray, encode::Json> codec;
@@ -291,10 +291,10 @@ SAW_TEST("Three Dim Array write and read"){
native = {};
eov = codec.decode(json, native);
SAW_EXPECT(eov.is_value(), "Decoding error");
- SAW_EXPECT(native.at(0,0,0) == "multi", "Invalid Value at 0,0,0");
- SAW_EXPECT(native.at(0,0,1) == "baz", "Invalid Value at 0,0,1");
- SAW_EXPECT(native.at(1,0,0) == "foo", "Invalid Value at 1,0,0");
- SAW_EXPECT(native.at(1,0,1) == "bar", "Invalid Value at 1,0,1");
+ SAW_EXPECT(native.at({0,0,0}) == "multi", "Invalid Value at 0,0,0");
+ SAW_EXPECT(native.at({0,0,1}) == "baz", "Invalid Value at 0,0,1");
+ SAW_EXPECT(native.at({1,0,0}) == "foo", "Invalid Value at 1,0,0");
+ SAW_EXPECT(native.at({1,0,1}) == "bar", "Invalid Value at 1,0,1");
}
diff --git a/modules/codec-netcdf/tests/codec-netcdf.cpp b/modules/codec-netcdf/tests/codec-netcdf.cpp
index 7e624df..540f60e 100644
--- a/modules/codec-netcdf/tests/codec-netcdf.cpp
+++ b/modules/codec-netcdf/tests/codec-netcdf.cpp
@@ -97,7 +97,7 @@ SAW_TEST("NetCDF Struct Array read"){
for(std::size_t i = 0; i < 5; ++i){
for(std::size_t j = 0; j < 3; ++j){
int64_t exp_val = i * 3 + j;
- SAW_EXPECT(arr.at(i,j).get() == exp_val, "Incorrect value");
+ SAW_EXPECT(arr.at({i,j}).get() == exp_val, "Incorrect value");
}
}
}
diff --git a/modules/crypto/c++/hash.hpp b/modules/crypto/c++/hash.hpp
index 8e8ca86..d7cf94d 100644
--- a/modules/crypto/c++/hash.hpp
+++ b/modules/crypto/c++/hash.hpp
@@ -14,14 +14,14 @@ template<>
class hash<crypto::Argon2i> {
public:
error_or<data<schema::String>> apply(const data<schema::String>& input, const data<schema::String>& salt){
- SAW_ASSERT(input.size() > 0u){
+ SAW_ASSERT(input.size().get() > 0u){
return make_error<err::invalid_state>("Strings for hashing shouldn't be zero");
}
uint32_t t_cost = 2;
uint32_t m_cost = 1<<16;
uint32_t parallel = 1;
const char* salt_c_ptr = nullptr;
- if(salt.size() > 0){
+ if(salt.size().get() > 0){
salt_c_ptr = &salt.at(0);
}
data<schema::String> hash;
@@ -30,7 +30,7 @@ public:
}catch(const std::exception&){
return make_error<err::out_of_memory>("Couldn't allocate hash string");
}
- int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size(), salt_c_ptr, salt.size(), &hash.at(0), hash.size());
+ int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size().get(), salt_c_ptr, salt.size().get(), &hash.at(0), hash.size().get());
if(rv != ARGON2_OK){
return make_error<err::invalid_state>("Failed to hash");
}
diff --git a/modules/io_codec/examples/peer_echo_client.cpp b/modules/io_codec/examples/peer_echo_client.cpp
index 7cd6fe7..942deed 100644
--- a/modules/io_codec/examples/peer_echo_client.cpp
+++ b/modules/io_codec/examples/peer_echo_client.cpp
@@ -101,7 +101,7 @@ int main(int argc, char** argv){
exit(-2);
}
std::cout<<"Answer:\n";
- for(uint64_t i = 0u; i < nat_resp.size(); ++i){
+ for(uint64_t i = 0u; i < nat_resp.size().get(); ++i){
if (nat_resp.at(i) != nat_echo.at(i)){
exit(-3);
}
diff --git a/modules/io_codec/examples/peer_echo_server.cpp b/modules/io_codec/examples/peer_echo_server.cpp
index 5670953..4d201c0 100644
--- a/modules/io_codec/examples/peer_echo_server.cpp
+++ b/modules/io_codec/examples/peer_echo_server.cpp
@@ -70,7 +70,7 @@ int main(){
return eov;
}
}
- for(uint64_t i = 0u; i < nat_resp.size(); ++i){
+ for(uint64_t i = 0u; i < nat_resp.size().get(); ++i){
std::cout<<nat_resp.at(i);
}
std::cout<<std::endl;
diff --git a/modules/remote-filesystem/examples/remote_read_file.cpp b/modules/remote-filesystem/examples/remote_read_file.cpp
index b0b2c89..39979d3 100644
--- a/modules/remote-filesystem/examples/remote_read_file.cpp
+++ b/modules/remote-filesystem/examples/remote_read_file.cpp
@@ -52,7 +52,7 @@ int main(){
}
std::cout<<"a: ";
- for(uint64_t i = 0; i < nat_foo.template get<"a">().size();++i) std::cout<<nat_foo.template get<"a">().at(i);
+ for(uint64_t i = 0; i < nat_foo.template get<"a">().size().get();++i) std::cout<<nat_foo.template get<"a">().at(i);
std::cout<<"\nb: "<<nat_foo.template get<"b">().get()<<std::endl;
}
return 0;
diff --git a/modules/remote/tests/remote_loopback.cpp b/modules/remote/tests/remote_loopback.cpp
index bc04605..61ff0bc 100644
--- a/modules/remote/tests/remote_loopback.cpp
+++ b/modules/remote/tests/remote_loopback.cpp
@@ -36,7 +36,7 @@ SAW_TEST("Remote Loopback Data"){
auto& client = eo_client.get_value();
data<Schema> foo{4};
- for(uint64_t i = 0; i < foo.size(); ++i){
+ for(uint64_t i = 0; i < foo.size().get(); ++i){
foo.at(i).set(i * 2.0);
}
id<Schema> sent_id = [&](){
@@ -85,7 +85,7 @@ SAW_TEST("Remote Loopback Data"){
auto conv = client.receive(alloc_id);
auto eov = conv.take();
SAW_EXPECT(eov.is_value(), "Failed receive.");
- SAW_EXPECT(eov.get_value().size() == 4u, "Wrong received value.");
+ SAW_EXPECT(eov.get_value().size().get() == 4u, "Wrong received value.");
}
}