Commit fca5681a authored by Yann Garcia's avatar Yann Garcia
Browse files

Update test scenarios

parent 4a23002d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -433,6 +433,7 @@ func (am *AssetMgr) DeleteTable(tableName string) (err error) {

// CreateUe - Create new UE
func (am *AssetMgr) CreateUe(id string, name string, data map[string]interface{}) (err error) {
	log.Info(">>> CreateUe")
	if profiling {
		profilingTimers["CreateUe"] = time.Now()
	}
@@ -2171,6 +2172,8 @@ func (am *AssetMgr) GetPowerValuesForCoordinates(coordinates []Coordinate) ([]Co
		}
		if maxRsrp != minCell4gRsrp && maxRsrq != minCell4gRsrq {
			newCoordinatePowerValue.PoaName = bestPoa
		} else {
			newCoordinatePowerValue.PoaName = "" // TODO Check if empty string is the most significant value to be used
		}

		CoordinatePowerValues = append(CoordinatePowerValues, newCoordinatePowerValue)
+14 −12
Original line number Diff line number Diff line
@@ -1660,11 +1660,11 @@ func TestAssetMgrGetPowerValuesForCoordinates(t *testing.T) {
	coordinates[0] = Coordinate { float32(lat), float32(lon) }
	fmt.Println(coordinates)
	ret_value, err = am.GetPowerValuesForCoordinates(coordinates)
	fmt.Println("--- ret_value", ret_value)
	fmt.Println("--- err", err)
	if err != nil {
		t.Fatalf("Unexpected error returned: " + err.Error())
	}
	fmt.Println("--- ret_value", ret_value)
	if len(ret_value) != 1 {
		t.Fatalf("Only one item is expected")
	}
@@ -1677,32 +1677,34 @@ func TestAssetMgrGetPowerValuesForCoordinates(t *testing.T) {
	// Check multiple items list of coordinates
	fmt.Println("Check multiple item length list of coordinates")
	m = r.FindStringSubmatch(point2)
	lon, err = strconv.ParseFloat(m[1], 32)
	lat, err = strconv.ParseFloat(m[2], 32)
	lon, _ = strconv.ParseFloat(m[1], 32)
	lat, _ = strconv.ParseFloat(m[2], 32)
	coordinates = make([]Coordinate, 3)
	coordinates[0] = Coordinate { float32(lat), float32(lon) }
	m = r.FindStringSubmatch(point3)
	lon, err = strconv.ParseFloat(m[1], 32)
	lat, err = strconv.ParseFloat(m[2], 32)
	lon, _ = strconv.ParseFloat(m[1], 32)
	lat, _ = strconv.ParseFloat(m[2], 32)
	coordinates[1] = Coordinate { float32(lat), float32(lon) }
	m = r.FindStringSubmatch(point5)
	lon, err = strconv.ParseFloat(m[1], 32)
	lat, err = strconv.ParseFloat(m[2], 32)
	lon, _ = strconv.ParseFloat(m[1], 32)
	lat, _ = strconv.ParseFloat(m[2], 32)
	coordinates[2] = Coordinate { float32(lat), float32(lon) }
	fmt.Println(coordinates)
	ret_value, err = am.GetPowerValuesForCoordinates(coordinates)
	fmt.Println("--- ret_value", ret_value)
	fmt.Println("--- err", err)
	if err != nil {
		t.Fatalf("Unexpected error returned: " + err.Error())
	}
	fmt.Println("--- err", err)
	if len(ret_value) != 3 {
		t.Fatalf("Only one item is expected")
	}
	/*var expectd_value []CoordinatePowerValue = make ([]CoordinatePowerValue, 1)
	expectd_value[0] = CoordinatePowerValue { float32(43.7342), float32(7.418522), 12, 54, "poa1" }
	expectd_value = make ([]CoordinatePowerValue, 3)
	expectd_value[0] = CoordinatePowerValue { float32(43.736977), float32(7.421501), -2, 40, "" }
	expectd_value[1] = CoordinatePowerValue { float32(43.732285), float32(7.422441), -2, 40, "" }
	expectd_value[2] = CoordinatePowerValue { float32(43.73153), float32(7.417135), -2, 40, "" }
	if expectd_value[0] != ret_value[0] {
		t.Fatalf("OUnexpected value was returned")
	}*/
		t.Fatalf("Unexpected value was returned")
	}

}