scilab: check char* array typemaps in scilab_li_matrix test
This commit is contained in:
parent
89d4dac99d
commit
1bcc17069c
2 changed files with 4 additions and 6 deletions
|
|
@ -54,6 +54,9 @@ test_matrix_typemaps("int", int32(m), m, sum(m), m .* m);
|
||||||
|
|
||||||
test_matrix_typemaps("double", m, m, sum(m), m .* m);
|
test_matrix_typemaps("double", m, m, sum(m), m .* m);
|
||||||
|
|
||||||
|
m = ["A" "D"; "B" "E"; "C" "F"]
|
||||||
|
test_matrix_typemaps("charptr", m, m, strcat(m), m + m);
|
||||||
|
|
||||||
m = [%T, %F; %F, %T; %T, %F];
|
m = [%T, %F; %F, %T; %T, %F];
|
||||||
test_matrix_typemaps("bool", m, m, %T, ~m);
|
test_matrix_typemaps("bool", m, m, %T, ~m);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,6 @@
|
||||||
%use_matrix_apply(char *);
|
%use_matrix_apply(char *);
|
||||||
%use_matrix_apply(bool);
|
%use_matrix_apply(bool);
|
||||||
|
|
||||||
%{
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
%}
|
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
// int and double matrix functions
|
// int and double matrix functions
|
||||||
|
|
@ -69,7 +64,7 @@ template<> void out_matrix_func(char ***resultMatrix, int *nbRowRes, int *nbColR
|
||||||
*resultMatrix = (char **) malloc(size * sizeof(char *));
|
*resultMatrix = (char **) malloc(size * sizeof(char *));
|
||||||
for (i=0; i<size; i++) {
|
for (i=0; i<size; i++) {
|
||||||
s = (char *) malloc(sizeof(char)+1);
|
s = (char *) malloc(sizeof(char)+1);
|
||||||
sprintf(s, "%d", i);
|
sprintf(s, "%c", char(65 + i));
|
||||||
(*resultMatrix)[i] = s;
|
(*resultMatrix)[i] = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue