1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-24 02:03:52 +03:00

Fix scons tests for xml-rpc-c with gcc 4.6

This commit is contained in:
Ruben S. Montero 2011-04-22 00:39:17 +02:00
parent bcbcadd9e1
commit dfc858a23a

View File

@ -69,24 +69,24 @@ main(int argc, char **) {
vector<xmlrpc_c::value> const paramArrayValue(resultArray.vectorValueValue());
//check posible Errors:
xmlrpc_c::value * firstvalue;
firstvalue = &(static_cast<xmlrpc_c::value>(paramArrayValue[0]));
xmlrpc_c::value_boolean * status = &(static_cast<xmlrpc_c::value_boolean>(*firstvalue));
xmlrpc_c::value firstvalue;
firstvalue = static_cast<xmlrpc_c::value>(paramArrayValue[0]);
xmlrpc_c::value_boolean status = static_cast<xmlrpc_c::value_boolean>(firstvalue);
xmlrpc_c::value * secondvalue;
secondvalue = &(static_cast<xmlrpc_c::value>(paramArrayValue[1]));
xmlrpc_c::value_string * valueS = &(static_cast<xmlrpc_c::value_string>(*secondvalue));
xmlrpc_c::value secondvalue;
secondvalue = static_cast<xmlrpc_c::value>(paramArrayValue[1]);
xmlrpc_c::value_string valueS = static_cast<xmlrpc_c::value_string>(secondvalue);
if(static_cast<bool>(*status)) {
if(static_cast<bool>(status)) {
//Success, returns the id assigned to the VM:
cout << "vmid returned: " << static_cast<string>(*valueS) << endl;
cout << "vmid returned: " << static_cast<string>(valueS) << endl;
return 0;
}
else{ //Failure:
string error_value=static_cast<string>(*valueS);
string error_value=static_cast<string>(valueS);
if (error_value.find("Error inserting",0)!=string::npos ) cout << "Error inserting VM in the database" << endl;
else if (error_value.find("Error parsing",0)!=string::npos ) cout << "Error parsing VM template" << endl;
else cout << "Unknown error " << static_cast<string>(*valueS) << endl;
else cout << "Unknown error " << static_cast<string>(valueS) << endl;
};
} catch (girerr::error const error) {
cerr << "Client threw error: " << error.what() << endl;