Measurements of CO2 trapping in carbonate and sandstone rocks