From 98b50ead7333a53e6464a2918f1be8849093158e Mon Sep 17 00:00:00 2001 From: Mika Laitio Date: Wed, 15 Aug 2012 23:05:13 +0300 Subject: [PATCH] add test method for querying data between dates Signed-off-by: Mika Laitio --- src_client/NetworkServiceClient_W1.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src_client/NetworkServiceClient_W1.cc b/src_client/NetworkServiceClient_W1.cc index 7d801be..44dcd73 100644 --- a/src_client/NetworkServiceClient_W1.cc +++ b/src_client/NetworkServiceClient_W1.cc @@ -30,6 +30,8 @@ int main(int argc, char** argv) int err_flg; Data *data; DataRange *dr; + Date sdate; + Date edate; dev_lst = NULL; controller = new DeviceManagerController(); @@ -64,10 +66,23 @@ int main(int argc, char** argv) if (data != NULL) { log_debug("last data for device: %s\n", id.c_str()); data->printout(); + + edate = data->get_date(); delete(data); + + edate.copy(&sdate); + edate.day = edate.day; + sdate.day = sdate.day - 2; + DataRange *dr2; + + log_debug("first date: %s\n", sdate.to_string().c_str()); + log_debug("last date: %s\n", edate.to_string().c_str()); + dr2 = controller->get_data(id, &sdate, &edate, &err_flg); + dr2->printout(); + delete(dr2); } + delete(dr); } - delete(dr); } } else { -- 2.41.1