Revert "Revert command line array object because it's broken by design"
This reverts commit a57c7f751023fe1d1edeabbf8683574ac7497e5e.
I pretty much hate to just revert your revert, but you failed to read my
replies, and failed to understand what i was talking about.
And YES we talked at fosdem about the platform issue, and do you
remember my answer, that back in time this might be the case, today is
different freebsd suppoerts setenv, and for windows we have a setenv
implementation in evil. And yes, vtorri also created a issue how bad and
evil this commit is, however, i still fail to see the issue since setenv
unsetenv and clearenv usages are taken as needed. (T7693)
The ownership question is answered in
https://phab.enlightenment.org/D7516#137367.
Can we please get into a state of technical discussions, and not *oh
shit, i am going to revert this* this has been in review for a long
time, a lots of people have tested it, we discussed things on it, and
there was 3 weeks of no reply from you.
The issues that exist will be dealed with. Feel free to create tasks if
you want :)
2019-02-12 12:34:30 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define EFL_CORE_COMMAND_LINE_PROTECTED
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#define EFL_NOLEGACY_API_SUPPORT
|
|
|
|
#include <Efl_Core.h>
|
|
|
|
#include "efl_app_suite.h"
|
|
|
|
#include "../efl_check.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
|
|
} Efl_App_Test_CML_Data;
|
|
|
|
|
2020-09-20 06:23:26 -07:00
|
|
|
#define ECORETEST_API
|
|
|
|
#define ECORETEST_API_WEAK
|
|
|
|
|
Revert "Revert command line array object because it's broken by design"
This reverts commit a57c7f751023fe1d1edeabbf8683574ac7497e5e.
I pretty much hate to just revert your revert, but you failed to read my
replies, and failed to understand what i was talking about.
And YES we talked at fosdem about the platform issue, and do you
remember my answer, that back in time this might be the case, today is
different freebsd suppoerts setenv, and for windows we have a setenv
implementation in evil. And yes, vtorri also created a issue how bad and
evil this commit is, however, i still fail to see the issue since setenv
unsetenv and clearenv usages are taken as needed. (T7693)
The ownership question is answered in
https://phab.enlightenment.org/D7516#137367.
Can we please get into a state of technical discussions, and not *oh
shit, i am going to revert this* this has been in review for a long
time, a lots of people have tested it, we discussed things on it, and
there was 3 weeks of no reply from you.
The issues that exist will be dealed with. Feel free to create tasks if
you want :)
2019-02-12 12:34:30 -08:00
|
|
|
#include "efl_app_test_cml.eo.h"
|
|
|
|
#include "efl_app_test_cml.eo.c"
|
|
|
|
|
|
|
|
static Eina_Array*
|
|
|
|
_construct_array(void)
|
|
|
|
{
|
|
|
|
Eina_Array *array = eina_array_new(16);
|
|
|
|
|
2019-02-14 03:28:23 -08:00
|
|
|
eina_array_push(array, eina_stringshare_add("/bin/sh"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("-C"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("foo"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("--test"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("--option=done"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("--"));
|
|
|
|
eina_array_push(array, eina_stringshare_add("asdf --test"));
|
Revert "Revert command line array object because it's broken by design"
This reverts commit a57c7f751023fe1d1edeabbf8683574ac7497e5e.
I pretty much hate to just revert your revert, but you failed to read my
replies, and failed to understand what i was talking about.
And YES we talked at fosdem about the platform issue, and do you
remember my answer, that back in time this might be the case, today is
different freebsd suppoerts setenv, and for windows we have a setenv
implementation in evil. And yes, vtorri also created a issue how bad and
evil this commit is, however, i still fail to see the issue since setenv
unsetenv and clearenv usages are taken as needed. (T7693)
The ownership question is answered in
https://phab.enlightenment.org/D7516#137367.
Can we please get into a state of technical discussions, and not *oh
shit, i am going to revert this* this has been in review for a long
time, a lots of people have tested it, we discussed things on it, and
there was 3 weeks of no reply from you.
The issues that exist will be dealed with. Feel free to create tasks if
you want :)
2019-02-12 12:34:30 -08:00
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char*
|
|
|
|
_construct_string(void)
|
|
|
|
{
|
|
|
|
return "/bin/sh -C foo --test --option=done -- \"asdf --test\"";
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_START_TEST(efl_core_cml_string)
|
|
|
|
{
|
|
|
|
Efl_App_Test_CML *cml = efl_add_ref(EFL_APP_TEST_CML_CLASS, NULL);
|
|
|
|
Eina_Array *content = _construct_array();
|
|
|
|
Eina_Stringshare *str;
|
|
|
|
Eina_Bool b;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
b = efl_core_command_line_command_string_set(cml, _construct_string());
|
|
|
|
ck_assert_int_ne(b, 0);
|
|
|
|
|
|
|
|
EINA_ACCESSOR_FOREACH(efl_core_command_line_command_access(cml), i, str)
|
|
|
|
{
|
|
|
|
ck_assert_str_eq(eina_array_data_get(content, i), str);
|
|
|
|
}
|
|
|
|
ck_assert_str_eq(efl_core_command_line_command_get(cml), _construct_string());
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
EFL_START_TEST(efl_core_cml_array)
|
|
|
|
{
|
|
|
|
Efl_App_Test_CML *cml = efl_add_ref(EFL_APP_TEST_CML_CLASS, NULL);
|
|
|
|
Eina_Array *content1 = _construct_array();
|
|
|
|
Eina_Array *content2 = _construct_array();
|
|
|
|
Eina_Stringshare *str;
|
|
|
|
Eina_Bool b;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
b = efl_core_command_line_command_array_set(cml, content1);
|
|
|
|
ck_assert_int_ne(b, 0);
|
|
|
|
|
|
|
|
EINA_ACCESSOR_FOREACH(efl_core_command_line_command_access(cml), i, str)
|
|
|
|
{
|
|
|
|
ck_assert_str_eq(eina_array_data_get(content2, i), str);
|
|
|
|
}
|
|
|
|
ck_assert_str_eq(efl_core_command_line_command_get(cml), _construct_string());
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
void efl_test_efl_cml(TCase *tc)
|
|
|
|
{
|
|
|
|
tcase_add_test(tc, efl_core_cml_string);
|
|
|
|
tcase_add_test(tc, efl_core_cml_array);
|
|
|
|
}
|