// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

//Errors in transform and transformc
shader
test_matrixcolor (
    output color Cout_color = 0, 
    output color Cout_matrix = 0,
    output color Cout_color1 = 0,
    output color Cout_matrix1 = 0)
{
    
    color uv = color (u, v, 0.5);
    Cout_color = transformc("spam"/*from*/,"hsv"/*to*/,uv);
    
    Cout_color1 = transformc("hsv", "spam", uv);

    matrix m1 = matrix(0);
    getmatrix("object", "spam", m1);

    matrix m11 = matrix(0);
    getmatrix("water", "object", m11); //Error will not get printed if unknown transform space on two consecutive calls.


    Cout_matrix = color(m1[0][0] + m1[0][1] + m1[0][2] + m1[0][3],
                 m1[1][0] + m1[1][1] + m1[1][2] + m1[1][3],
                 m1[2][0] + m1[2][1] + m1[2][2] + m1[2][3] +
                 m1[3][0] + m1[3][1] + m1[3][2] + m1[3][3]);

   
    Cout_matrix1 = color(m11[0][0] + m11[0][1] + m11[0][2] + m11[0][3],
                 m11[1][0] + m11[1][1] + m11[1][2] + m11[1][3],
                 m11[2][0] + m11[2][1] + m11[2][2] + m11[2][3] +
                 m11[3][0] + m11[3][1] + m11[3][2] + m11[3][3]);


}
