17 status_t
DecodeResult(status_t result
) {
18 if (!BTestShell::GlobalBeVerbose())
38 case B_FILE_NOT_FOUND
:
39 str
= "B_FILE_NOT_FOUND";
43 str
= "B_FILE_EXISTS";
46 case B_ENTRY_NOT_FOUND
:
47 str
= "B_ENTRY_NOT_FOUND";
51 str
= "B_NAME_TOO_LONG";
54 case B_DIRECTORY_NOT_EMPTY
:
55 str
= "B_DIRECTORY_NOT_EMPTY";
59 str
= "B_DEVICE_FULL";
62 case B_READ_ONLY_DEVICE
:
63 str
= "B_READ_ONLY_DEVICE";
66 case B_IS_A_DIRECTORY
:
67 str
= "B_IS_A_DIRECTORY";
71 str
= "B_NO_MORE_FDS";
74 case B_CROSS_DEVICE_LINK
:
75 str
= "B_CROSS_DEVICE_LINK";
83 str
= "B_BUSTED_PIPE";
87 str
= "B_UNSUPPORTED";
90 case B_PARTITION_TOO_SMALL
:
91 str
= "B_PARTITION_TOO_SMALL";
95 str
= "B_PARTIAL_READ";
99 str
= "B_PARTIAL_WRITE";
102 case B_BAD_MIME_SNIFFER_RULE
:
103 str
= "B_BAD_MIME_SNIFFER_RULE";
115 case B_PERMISSION_DENIED
:
116 str
= "B_PERMISSION_DENIED";
131 case B_MISMATCHED_VALUES
:
132 str
= "B_MISMATCHED_VALUES";
135 case B_NAME_NOT_FOUND
:
136 str
= "B_NAME_NOT_FOUND";
140 str
= "B_NAME_IN_USE";
148 str
= "B_INTERRUPTED";
152 str
= "B_WOULD_BLOCK";
168 str
= "B_NOT_ALLOWED";
174 str
= "B_BAD_ADDRESS";
178 str
= "B_BAD_TEAM_ID";
183 str
= "B_BAD_PORT_ID";
193 cout
<< endl
<< "DecodeResult() -- " "0x" << hex
<< result
<< " (" << dec
<< result
<< ") == " << str
<< endl
;
199 string
IntToStr(int i
) {
201 sprintf(num
, "%d", i
);
206 void ExecCommand(const char *command
) {
212 void ExecCommand(const char *command
, const char *parameter
) {
213 if (command
&& parameter
) {
214 char *cmdLine
= new char[strlen(command
) + strlen(parameter
) + 1];
215 strcpy(cmdLine
, command
);
216 strcat(cmdLine
, parameter
);
223 void ExecCommand(const char *command
, const char *parameter1
,
224 const char *parameter2
) {
225 if (command
&& parameter1
&& parameter2
) {
226 char *cmdLine
= new char[strlen(command
) + strlen(parameter1
)
227 + 1 + strlen(parameter2
) + 1];
228 strcpy(cmdLine
, command
);
229 strcat(cmdLine
, parameter1
);
230 strcat(cmdLine
, " ");
231 strcat(cmdLine
, parameter2
);